Search in sources :

Example 1 with JMSTransportFactory

use of org.apache.cxf.transport.jms.JMSTransportFactory 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)

Aggregations

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