Search in sources :

Example 1 with SeekBookInBasementFaultCallback

use of org.talend.esb.mep.requestcallback.sample.internal.SeekBookInBasementFaultCallback in project tesb-rt-se by Talend.

the class RequestCallbackJmsTest method initialize.

@Before
public void initialize() throws Exception {
    if (mep == NO_RUN) {
        return;
    }
    final Bus bus = BusFactory.getDefaultBus();
    final JMSTransportFactory jmsTransport = new JMSTransportFactory();
    final DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
    dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", jmsTransport);
    dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/jms", jmsTransport);
    dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", jmsTransport);
    dfm.registerDestinationFactory("http://cxf.apache.org/bindings/xformat", jmsTransport);
    final ConduitInitiatorManager extension = bus.getExtension(ConduitInitiatorManager.class);
    extension.registerConduitInitiator("http://schemas.xmlsoap.org/wsdl/soap/http", jmsTransport);
    extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/http", jmsTransport);
    extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/jms", jmsTransport);
    extension.registerConduitInitiator("http://cxf.apache.org/bindings/xformat", jmsTransport);
    final WSDLServiceFactory wsdlSvcFactory = new WSDLServiceFactory(CXFBusFactory.getThreadDefaultBus(), wsdlLocation);
    final org.apache.cxf.service.Service cxfService = wsdlSvcFactory.create();
    final ServiceInfo si = findServiceByName(cxfService, serviceName);
    if (si == null) {
        throw new RuntimeException("WSDL does not contain service " + serviceName);
    }
    final EndpointInfo ei = findEndpoint(si, portName);
    if (ei == null) {
        throw new RuntimeException("WSDL does not contain port " + portName);
    }
    endpointInfo = ei;
    callbackMap.put("seekBookInBasementResponse", new SeekBookInBasementResponseCallback(messageTransfer));
    callbackMap.put("seekBookInBasementFault", new SeekBookInBasementFaultCallback(messageTransfer));
}
Also used : Bus(org.apache.cxf.Bus) WSDLServiceFactory(org.apache.cxf.wsdl11.WSDLServiceFactory) JMSTransportFactory(org.apache.cxf.transport.jms.JMSTransportFactory) DestinationFactoryManager(org.apache.cxf.transport.DestinationFactoryManager) ServiceInfo(org.apache.cxf.service.model.ServiceInfo) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) SeekBookInBasementResponseCallback(org.talend.esb.mep.requestcallback.sample.internal.SeekBookInBasementResponseCallback) ConduitInitiatorManager(org.apache.cxf.transport.ConduitInitiatorManager) SeekBookInBasementFaultCallback(org.talend.esb.mep.requestcallback.sample.internal.SeekBookInBasementFaultCallback) Before(org.junit.Before)

Example 2 with SeekBookInBasementFaultCallback

use of org.talend.esb.mep.requestcallback.sample.internal.SeekBookInBasementFaultCallback in project tesb-rt-se by Talend.

the class RequestCallbackTest method initialize.

@Before
public void initialize() throws Exception {
    if (mep == NO_RUN) {
        return;
    }
    final Bus bus = BusFactory.getDefaultBus();
    final LocalTransportFactory localTransport = new LocalTransportFactory();
    final DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
    dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
    dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/jms", localTransport);
    dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
    dfm.registerDestinationFactory("http://cxf.apache.org/bindings/xformat", localTransport);
    dfm.registerDestinationFactory("http://cxf.apache.org/transports/local", localTransport);
    final ConduitInitiatorManager extension = bus.getExtension(ConduitInitiatorManager.class);
    extension.registerConduitInitiator("http://cxf.apache.org/transports/local", localTransport);
    extension.registerConduitInitiator("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
    extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/http", localTransport);
    extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/jms", localTransport);
    extension.registerConduitInitiator("http://cxf.apache.org/bindings/xformat", localTransport);
    final WSDLServiceFactory wsdlSvcFactory = new WSDLServiceFactory(CXFBusFactory.getThreadDefaultBus(), wsdlLocation, SERVICE_NAME);
    final org.apache.cxf.service.Service cxfService = wsdlSvcFactory.create();
    final ServiceInfo si = findServiceByName(cxfService, SERVICE_NAME);
    if (si == null) {
        throw new RuntimeException("WSDL does not contain service " + SERVICE_NAME);
    }
    final EndpointInfo ei = findEndpoint(si, PORT_NAME);
    if (ei == null) {
        throw new RuntimeException("WSDL does not contain port " + PORT_NAME);
    }
    endpointInfo = ei;
    callbackMap.put("seekBookInBasementResponse", new SeekBookInBasementResponseCallback(messageTransfer));
    callbackMap.put("seekBookInBasementFault", new SeekBookInBasementFaultCallback(messageTransfer));
}
Also used : Bus(org.apache.cxf.Bus) WSDLServiceFactory(org.apache.cxf.wsdl11.WSDLServiceFactory) DestinationFactoryManager(org.apache.cxf.transport.DestinationFactoryManager) LocalTransportFactory(org.apache.cxf.transport.local.LocalTransportFactory) ServiceInfo(org.apache.cxf.service.model.ServiceInfo) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) SeekBookInBasementResponseCallback(org.talend.esb.mep.requestcallback.sample.internal.SeekBookInBasementResponseCallback) ConduitInitiatorManager(org.apache.cxf.transport.ConduitInitiatorManager) SeekBookInBasementFaultCallback(org.talend.esb.mep.requestcallback.sample.internal.SeekBookInBasementFaultCallback) Before(org.junit.Before)

Aggregations

Bus (org.apache.cxf.Bus)2 EndpointInfo (org.apache.cxf.service.model.EndpointInfo)2 ServiceInfo (org.apache.cxf.service.model.ServiceInfo)2 ConduitInitiatorManager (org.apache.cxf.transport.ConduitInitiatorManager)2 DestinationFactoryManager (org.apache.cxf.transport.DestinationFactoryManager)2 WSDLServiceFactory (org.apache.cxf.wsdl11.WSDLServiceFactory)2 Before (org.junit.Before)2 SeekBookInBasementFaultCallback (org.talend.esb.mep.requestcallback.sample.internal.SeekBookInBasementFaultCallback)2 SeekBookInBasementResponseCallback (org.talend.esb.mep.requestcallback.sample.internal.SeekBookInBasementResponseCallback)2 JMSTransportFactory (org.apache.cxf.transport.jms.JMSTransportFactory)1 LocalTransportFactory (org.apache.cxf.transport.local.LocalTransportFactory)1