Search in sources :

Example 1 with JaxWSTxOutboundBridgeHandler

use of org.jboss.jbossts.txbridge.outbound.JaxWSTxOutboundBridgeHandler in project cxf by apache.

the class FirstClient method newInstance.

public static FirstServiceAT newInstance() throws Exception {
    URL wsdlLocation = new URL("http://localhost:8081/Service/FirstServiceAT?wsdl");
    QName serviceName = new QName("http://service.ws.sample", "FirstServiceATService");
    QName portName = new QName("http://service.ws.sample", "FirstServiceAT");
    Service service = Service.create(wsdlLocation, serviceName);
    FirstServiceAT client = service.getPort(portName, FirstServiceAT.class);
    List<Handler> handlerChain = new ArrayList<>();
    JaxWSTxOutboundBridgeHandler txOutboundBridgeHandler = new JaxWSTxOutboundBridgeHandler();
    EnabledWSTXHandler wstxHandler = new EnabledWSTXHandler();
    handlerChain.add(txOutboundBridgeHandler);
    handlerChain.add(wstxHandler);
    ((BindingProvider) client).getBinding().setHandlerChain(handlerChain);
    return client;
}
Also used : QName(javax.xml.namespace.QName) ArrayList(java.util.ArrayList) Service(javax.xml.ws.Service) Handler(javax.xml.ws.handler.Handler) EnabledWSTXHandler(com.arjuna.mw.wst11.client.EnabledWSTXHandler) JaxWSTxOutboundBridgeHandler(org.jboss.jbossts.txbridge.outbound.JaxWSTxOutboundBridgeHandler) JaxWSTxOutboundBridgeHandler(org.jboss.jbossts.txbridge.outbound.JaxWSTxOutboundBridgeHandler) EnabledWSTXHandler(com.arjuna.mw.wst11.client.EnabledWSTXHandler) URL(java.net.URL)

Example 2 with JaxWSTxOutboundBridgeHandler

use of org.jboss.jbossts.txbridge.outbound.JaxWSTxOutboundBridgeHandler in project cxf by apache.

the class SecondClient method newInstance.

public static SecondServiceAT newInstance() throws Exception {
    URL wsdlLocation = new URL("http://localhost:8082/Service/SecondServiceAT?wsdl");
    QName serviceName = new QName("http://service.ws.sample", "SecondServiceATService");
    QName portName = new QName("http://service.ws.sample", "SecondServiceAT");
    Service service = Service.create(wsdlLocation, serviceName);
    SecondServiceAT client = service.getPort(portName, SecondServiceAT.class);
    List<Handler> handlerChain = new ArrayList<>();
    JaxWSTxOutboundBridgeHandler txOutboundBridgeHandler = new JaxWSTxOutboundBridgeHandler();
    EnabledWSTXHandler wstxHandler = new EnabledWSTXHandler();
    handlerChain.add(txOutboundBridgeHandler);
    handlerChain.add(wstxHandler);
    ((BindingProvider) client).getBinding().setHandlerChain(handlerChain);
    return client;
}
Also used : QName(javax.xml.namespace.QName) ArrayList(java.util.ArrayList) Service(javax.xml.ws.Service) Handler(javax.xml.ws.handler.Handler) EnabledWSTXHandler(com.arjuna.mw.wst11.client.EnabledWSTXHandler) JaxWSTxOutboundBridgeHandler(org.jboss.jbossts.txbridge.outbound.JaxWSTxOutboundBridgeHandler) JaxWSTxOutboundBridgeHandler(org.jboss.jbossts.txbridge.outbound.JaxWSTxOutboundBridgeHandler) EnabledWSTXHandler(com.arjuna.mw.wst11.client.EnabledWSTXHandler) URL(java.net.URL)

Example 3 with JaxWSTxOutboundBridgeHandler

use of org.jboss.jbossts.txbridge.outbound.JaxWSTxOutboundBridgeHandler in project narayana by jbosstm.

the class TestClient method init.

/**
 * Initialise the servlet.
 *
 * @param config The servlet configuration.
 */
public void init(final ServletConfig config) throws ServletException {
    try {
        Context ic = new InitialContext();
        userTransaction = (UserTransaction) ic.lookup("java:comp/UserTransaction");
        URL wsdlLocation = new URL("http://" + getLocalHost() + ":8080/txbridge-outbound-tests-service/TestServiceImpl?wsdl");
        QName serviceName = new QName("http://client.outbound.tests.txbridge.jbossts.jboss.org/", "TestServiceImplService");
        Service service = Service.create(wsdlLocation, serviceName);
        testService = service.getPort(TestService.class);
        BindingProvider bindingProvider = (BindingProvider) testService;
        List<Handler> handlers = new ArrayList<Handler>(2);
        handlers.add(new JaxWSTxOutboundBridgeHandler());
        handlers.add(new JaxWSHeaderContextProcessor());
        bindingProvider.getBinding().setHandlerChain(handlers);
        context = config.getServletContext();
    } catch (Exception e) {
        throw new ServletException(e);
    }
}
Also used : Context(javax.naming.Context) InitialContext(javax.naming.InitialContext) ServletContext(javax.servlet.ServletContext) JaxWSHeaderContextProcessor(com.arjuna.mw.wst11.client.JaxWSHeaderContextProcessor) QName(javax.xml.namespace.QName) ArrayList(java.util.ArrayList) Service(javax.xml.ws.Service) JaxWSTxOutboundBridgeHandler(org.jboss.jbossts.txbridge.outbound.JaxWSTxOutboundBridgeHandler) Handler(javax.xml.ws.handler.Handler) BindingProvider(javax.xml.ws.BindingProvider) JaxWSTxOutboundBridgeHandler(org.jboss.jbossts.txbridge.outbound.JaxWSTxOutboundBridgeHandler) InitialContext(javax.naming.InitialContext) URL(java.net.URL) ServletException(javax.servlet.ServletException) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException) RollbackException(com.arjuna.ats.jta.exceptions.RollbackException) ServletException(javax.servlet.ServletException)

Example 4 with JaxWSTxOutboundBridgeHandler

use of org.jboss.jbossts.txbridge.outbound.JaxWSTxOutboundBridgeHandler in project narayana by jbosstm.

the class TestATClient method getServiceWithManualHandlers.

private CommonTestService getServiceWithManualHandlers(boolean isWSATService) {
    CommonTestService testService;
    if (isWSATService) {
        Service service = Service.create(wsatServiceWsdlLocation, wsatServiceName);
        testService = service.getPort(TestATService.class);
    } else {
        Service service = Service.create(simpleServiceWsdlLocation, simpleServiceName);
        testService = service.getPort(TestNonATService.class);
    }
    BindingProvider bindingProvider = (BindingProvider) testService;
    List<Handler> handlers = new ArrayList<Handler>(2);
    handlers.add(new JaxWSTxOutboundBridgeHandler());
    handlers.add(new JaxWSHeaderContextProcessor());
    bindingProvider.getBinding().setHandlerChain(handlers);
    return testService;
}
Also used : JaxWSHeaderContextProcessor(com.arjuna.mw.wst11.client.JaxWSHeaderContextProcessor) ArrayList(java.util.ArrayList) Service(javax.xml.ws.Service) JaxWSTxOutboundBridgeHandler(org.jboss.jbossts.txbridge.outbound.JaxWSTxOutboundBridgeHandler) Handler(javax.xml.ws.handler.Handler) BindingProvider(javax.xml.ws.BindingProvider) JaxWSTxOutboundBridgeHandler(org.jboss.jbossts.txbridge.outbound.JaxWSTxOutboundBridgeHandler)

Aggregations

ArrayList (java.util.ArrayList)4 Service (javax.xml.ws.Service)4 Handler (javax.xml.ws.handler.Handler)4 JaxWSTxOutboundBridgeHandler (org.jboss.jbossts.txbridge.outbound.JaxWSTxOutboundBridgeHandler)4 URL (java.net.URL)3 QName (javax.xml.namespace.QName)3 EnabledWSTXHandler (com.arjuna.mw.wst11.client.EnabledWSTXHandler)2 JaxWSHeaderContextProcessor (com.arjuna.mw.wst11.client.JaxWSHeaderContextProcessor)2 BindingProvider (javax.xml.ws.BindingProvider)2 RollbackException (com.arjuna.ats.jta.exceptions.RollbackException)1 IOException (java.io.IOException)1 UnknownHostException (java.net.UnknownHostException)1 Context (javax.naming.Context)1 InitialContext (javax.naming.InitialContext)1 ServletContext (javax.servlet.ServletContext)1 ServletException (javax.servlet.ServletException)1