Search in sources :

Example 16 with Binding

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

the class BindingTester method testBindingInstances.

/*
     * get the binding object on dispatch object
     */
// public void testDispatch1() throws Exception {
// Dispatch dispatch = createDispatchForSource(
// new QName("urn:test", "TestServicePort"));
// assertNotNull("dispatch object is null", dispatch);
// Binding binding = dispatch.getBinding();
// assertNotNull("binding object should not be null", binding);
// List handlers = binding.getHandlerChain();
// assertNotNull("handler list should not be null", handlers);
// assertTrue("There should be no handlers in list", handlers.size() == 0);
// }
/*
     * Used for testing of handlers shared between bindings.
     */
public void testBindingInstances() throws Exception {
    TestService_Service service = getService();
    TestService stub1 = getTestStub(service);
    TestService stub2 = getTestStub(service);
    // make some calls
    stub1.testInt(0);
    stub2.testInt(0);
    Binding b1 = ((BindingProvider) stub1).getBinding();
    Binding b2 = ((BindingProvider) stub2).getBinding();
    List<Handler> chain = b1.getHandlerChain();
    // get a soap handler from the chain. doesn't matter which one
    BaseSOAPHandler handler = null;
    for (Handler h : chain) {
        if (h instanceof BaseSOAPHandler) {
            handler = (BaseSOAPHandler) h;
            break;
        }
    }
    assertTrue("handler should be in 'ready' state", handler.isAvailable());
    b2.setHandlerChain(new ArrayList<Handler>());
    assertTrue("handler should be in 'ready' state", handler.isAvailable());
}
Also used : SOAPBinding(jakarta.xml.ws.soap.SOAPBinding) Binding(jakarta.xml.ws.Binding) BaseSOAPHandler(fromwsdl.handler.common.BaseSOAPHandler) BaseSOAPHandler(fromwsdl.handler.common.BaseSOAPHandler) Handler(jakarta.xml.ws.handler.Handler) BindingProvider(jakarta.xml.ws.BindingProvider)

Example 17 with Binding

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

the class HandlerChainTester method testHandlersOnTestPort2.

public void testHandlersOnTestPort2() {
    TestService_Service service = getService();
    TestService testStub = service.getPort(TestService.class);
    Binding testBinding = ((BindingProvider) testStub).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)

Example 18 with Binding

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

the class HandlerChainTester method testHandlersOnTestPort3.

public void testHandlersOnTestPort3() {
    Service service = Service.create(WSDL_LOCATION, TESTSERVICE);
    TestService testStub = service.getPort(TESTSERVICEPORT, TestService.class);
    Binding testBinding = ((BindingProvider) testStub).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)

Example 19 with Binding

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

the class HandlerChainTester method testHandlersOnReportPort3.

public void testHandlersOnReportPort3() {
    Service service = Service.create(WSDL_LOCATION, TESTSERVICE);
    ReportService testStub = service.getPort(REPORTSERVICEPORT, ReportService.class);
    Binding testBinding = ((BindingProvider) testStub).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)

Example 20 with Binding

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

the class HandlerChainTester method testHandlersOnTestPort1.

public void testHandlersOnTestPort1() {
    Service service = Service.create(WSDL_LOCATION, TESTSERVICE);
    TestService testStub = service.getPort(TestService.class);
    Binding testBinding = ((BindingProvider) testStub).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)

Aggregations

Binding (jakarta.xml.ws.Binding)37 BindingProvider (jakarta.xml.ws.BindingProvider)32 Handler (jakarta.xml.ws.handler.Handler)30 SOAPBinding (jakarta.xml.ws.soap.SOAPBinding)17 ArrayList (java.util.ArrayList)8 SOAPTestHandler (fromwsdl.handler_simple.common.SOAPTestHandler)5 Service (jakarta.xml.ws.Service)5 WebServiceException (jakarta.xml.ws.WebServiceException)5 SOAPTestHandler (fromwsdl.handler_simple_rpclit.common.SOAPTestHandler)4 HTTPBinding (jakarta.xml.ws.http.HTTPBinding)4 Source (javax.xml.transform.Source)3 BaseSOAPHandler (fromwsdl.handler.common.BaseSOAPHandler)2 BaseSOAPHandler (handler.handler_processing.common.BaseSOAPHandler)2 ProtocolException (jakarta.xml.ws.ProtocolException)2 HandlerResolver (jakarta.xml.ws.handler.HandlerResolver)2 PortInfo (jakarta.xml.ws.handler.PortInfo)2 SOAPFaultException (jakarta.xml.ws.soap.SOAPFaultException)2 HashSet (java.util.HashSet)2 List (java.util.List)2 Localizable (com.sun.istack.localization.Localizable)1