Search in sources :

Example 46 with Handler

use of jakarta.xml.ws.handler.Handler in project metro-jax-ws by eclipse-ee4j.

the class HandlerChainTester method testHandlersOnReportPort2.

public void testHandlersOnReportPort2() {
    TestService_Service service = getService();
    ReportService testStub = service.getPort(ReportService.class);
    Binding testBinding = ((BindingProvider) testStub).getBinding();
    List<Handler> chain = testBinding.getHandlerChain();
    // System.out.println(chain.size());
    assertEquals(2, chain.size());
}
Also used : SOAPBinding(jakarta.xml.ws.soap.SOAPBinding) Binding(jakarta.xml.ws.Binding) Handler(jakarta.xml.ws.handler.Handler) BindingProvider(jakarta.xml.ws.BindingProvider)

Example 47 with Handler

use of jakarta.xml.ws.handler.Handler in project metro-jax-ws by eclipse-ee4j.

the class HandlerChainTester method testHandlersOnTestPortDispatch1.

public void testHandlersOnTestPortDispatch1() {
    Service service = Service.create(TESTSERVICE);
    String bindingId = SOAPBinding.SOAP11HTTP_BINDING;
    service.addPort(TESTSERVICEPORT, bindingId, endpointAddress);
    Dispatch<Source> dispatch = service.createDispatch(TESTSERVICEPORT, Source.class, Service.Mode.PAYLOAD);
    Binding testBinding = ((BindingProvider) dispatch).getBinding();
    List<Handler> chain = testBinding.getHandlerChain();
    // System.out.println(chain.size());
    assertEquals(0, chain.size());
}
Also used : SOAPBinding(jakarta.xml.ws.soap.SOAPBinding) Binding(jakarta.xml.ws.Binding) Service(jakarta.xml.ws.Service) Handler(jakarta.xml.ws.handler.Handler) BindingProvider(jakarta.xml.ws.BindingProvider) Source(javax.xml.transform.Source)

Example 48 with Handler

use of jakarta.xml.ws.handler.Handler in project metro-jax-ws by eclipse-ee4j.

the class HandlerChainTester method testHandlersOnReportPortDispatch.

public void testHandlersOnReportPortDispatch() {
    TestService_Service service = getService();
    Dispatch<Source> dispatch = service.createDispatch(REPORTSERVICEPORT, Source.class, Service.Mode.PAYLOAD);
    Binding testBinding = ((BindingProvider) dispatch).getBinding();
    List<Handler> chain = testBinding.getHandlerChain();
    // System.out.println(chain.size());
    assertEquals(2, chain.size());
}
Also used : SOAPBinding(jakarta.xml.ws.soap.SOAPBinding) Binding(jakarta.xml.ws.Binding) Handler(jakarta.xml.ws.handler.Handler) BindingProvider(jakarta.xml.ws.BindingProvider) Source(javax.xml.transform.Source)

Example 49 with Handler

use of jakarta.xml.ws.handler.Handler in project metro-jax-ws by eclipse-ee4j.

the class HandlerChainTester method testHandlersOnTestPortDispatch.

public void testHandlersOnTestPortDispatch() {
    TestService_Service service = getService();
    Dispatch<Source> dispatch = service.createDispatch(TESTSERVICEPORT, Source.class, Service.Mode.PAYLOAD);
    Binding testBinding = ((BindingProvider) dispatch).getBinding();
    List<Handler> chain = testBinding.getHandlerChain();
    // System.out.println(chain.size());
    assertEquals(3, chain.size());
}
Also used : SOAPBinding(jakarta.xml.ws.soap.SOAPBinding) Binding(jakarta.xml.ws.Binding) Handler(jakarta.xml.ws.handler.Handler) BindingProvider(jakarta.xml.ws.BindingProvider) Source(javax.xml.transform.Source)

Example 50 with Handler

use of jakarta.xml.ws.handler.Handler in project metro-jax-ws by eclipse-ee4j.

the class MessageContextTest method testRequestResponse.

public void testRequestResponse() throws Exception {
    HelloService helloService = new HelloService();
    Hello helloPort = helloService.getHelloPort();
    Binding binding = ((BindingProvider) helloPort).getBinding();
    List<Handler> handlers = new ArrayList<Handler>();
    handlers.add(new TestHandler("CLIENT-SIDE"));
    binding.setHandlerChain(handlers);
    int x = 1;
    int y = helloPort.sayHello(x);
    assertTrue(y == x);
}
Also used : Binding(jakarta.xml.ws.Binding) TestHandler(handler.context_wsdl_op.common.TestHandler) ArrayList(java.util.ArrayList) TestHandler(handler.context_wsdl_op.common.TestHandler) Handler(jakarta.xml.ws.handler.Handler) BindingProvider(jakarta.xml.ws.BindingProvider)

Aggregations

Handler (jakarta.xml.ws.handler.Handler)53 Binding (jakarta.xml.ws.Binding)30 BindingProvider (jakarta.xml.ws.BindingProvider)28 ArrayList (java.util.ArrayList)22 SOAPBinding (jakarta.xml.ws.soap.SOAPBinding)15 SOAPTestHandler (fromwsdl.handler_simple.common.SOAPTestHandler)7 Service (jakarta.xml.ws.Service)7 List (java.util.List)7 WebServiceException (jakarta.xml.ws.WebServiceException)6 HandlerResolver (jakarta.xml.ws.handler.HandlerResolver)6 PortInfo (jakarta.xml.ws.handler.PortInfo)6 SOAPTestHandler (fromwsdl.handler_simple_rpclit.common.SOAPTestHandler)5 InitialContext (javax.naming.InitialContext)5 HandlerChainInfo (org.apache.openejb.assembler.classic.HandlerChainInfo)5 HandlerChains (org.apache.openejb.jee.HandlerChains)5 BaseSOAPHandler (fromwsdl.handler.common.BaseSOAPHandler)4 LogicalHandler (jakarta.xml.ws.handler.LogicalHandler)4 QName (javax.xml.namespace.QName)4 Source (javax.xml.transform.Source)4 HandlerTracker (fromwsdl.handler.common.HandlerTracker)3