Search in sources :

Example 1 with JaxWSHeaderContextProcessor

use of com.arjuna.mw.wst11.client.JaxWSHeaderContextProcessor 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 {
        URL wsdlLocation = new URL("http://" + getLocalHost() + ":8080/txbridge-inbound-tests-service/TestServiceImpl?wsdl");
        QName serviceName = new QName("http://client.inbound.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>(1);
        handlers.add(new JaxWSHeaderContextProcessor());
        bindingProvider.getBinding().setHandlerChain(handlers);
        context = config.getServletContext();
    } catch (Exception e) {
        throw new ServletException(e);
    }
}
Also used : ServletException(javax.servlet.ServletException) JaxWSHeaderContextProcessor(com.arjuna.mw.wst11.client.JaxWSHeaderContextProcessor) QName(javax.xml.namespace.QName) ArrayList(java.util.ArrayList) Service(javax.xml.ws.Service) Handler(javax.xml.ws.handler.Handler) BindingProvider(javax.xml.ws.BindingProvider) URL(java.net.URL) ServletException(javax.servlet.ServletException) TransactionRolledBackException(com.arjuna.wst.TransactionRolledBackException) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException)

Example 2 with JaxWSHeaderContextProcessor

use of com.arjuna.mw.wst11.client.JaxWSHeaderContextProcessor in project narayana by jbosstm.

the class TestServiceBAClient method getClientWithManuallyAddedHandler.

public static TestServiceBA getClientWithManuallyAddedHandler() throws MalformedURLException {
    TestServiceBAClient client = new TestServiceBAClient();
    Service service = Service.create(new URL(WSDL_URL), SERVICE_NAME);
    client.testService = service.getPort(PORT_NAME, TestServiceBA.class);
    BindingProvider bindingProvider = (BindingProvider) client.testService;
    @SuppressWarnings("rawtypes") List<Handler> handlers = new ArrayList<Handler>(1);
    handlers.add(new JaxWSHeaderContextProcessor());
    bindingProvider.getBinding().setHandlerChain(handlers);
    return client;
}
Also used : JaxWSHeaderContextProcessor(com.arjuna.mw.wst11.client.JaxWSHeaderContextProcessor) ArrayList(java.util.ArrayList) Service(javax.xml.ws.Service) Handler(javax.xml.ws.handler.Handler) BindingProvider(javax.xml.ws.BindingProvider) URL(java.net.URL)

Example 3 with JaxWSHeaderContextProcessor

use of com.arjuna.mw.wst11.client.JaxWSHeaderContextProcessor in project narayana by jbosstm.

the class TestServiceATClient method getClientWithManuallyAddedHandler.

public static TestServiceAT getClientWithManuallyAddedHandler() throws MalformedURLException {
    TestServiceATClient client = new TestServiceATClient();
    Service service = Service.create(new URL(WSDL_URL), SERVICE_NAME);
    client.testService = service.getPort(PORT_NAME, TestServiceAT.class);
    BindingProvider bindingProvider = (BindingProvider) client.testService;
    @SuppressWarnings("rawtypes") List<Handler> handlers = new ArrayList<Handler>(1);
    handlers.add(new JaxWSHeaderContextProcessor());
    bindingProvider.getBinding().setHandlerChain(handlers);
    return client;
}
Also used : JaxWSHeaderContextProcessor(com.arjuna.mw.wst11.client.JaxWSHeaderContextProcessor) ArrayList(java.util.ArrayList) Service(javax.xml.ws.Service) Handler(javax.xml.ws.handler.Handler) BindingProvider(javax.xml.ws.BindingProvider) URL(java.net.URL)

Example 4 with JaxWSHeaderContextProcessor

use of com.arjuna.mw.wst11.client.JaxWSHeaderContextProcessor 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 5 with JaxWSHeaderContextProcessor

use of com.arjuna.mw.wst11.client.JaxWSHeaderContextProcessor 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

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