Search in sources :

Example 6 with Binding

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

the class HandlerClient method testSOAP12Binding1.

/*
     * The normal tests in this file are for soap 1.1. This is a soap 1.2
     * test to make sure that the port is created with the proper binding
     * so that the proper handlers are called. See bug 6353179.
     *
     * Not working right now -- can't get endpoint to work.
     */
public void testSOAP12Binding1() throws Exception {
    Hello_Service service = createService();
    Hello12 stub = create12Stub(service);
    // make sure port is working
    int x = 1;
    // server handler only
    int diff = 2;
    int y = stub.hello12(x);
    assertEquals(x + diff, y);
    Binding binding = ((BindingProvider) stub).getBinding();
    List<Handler> handlers = binding.getHandlerChain();
    assertEquals("should be 1 handler in chain", 1, handlers.size());
    Handler handler = handlers.get(0);
    assertTrue("handler should be type Port12Handler, not " + handler.getClass().toString(), handler instanceof Port12Handler);
    Port12Handler p12h = (Port12Handler) handler;
    p12h.resetCalled();
    stub.hello12(2);
    assertEquals("handler should have been called two times", 2, p12h.getCalled());
}
Also used : Binding(jakarta.xml.ws.Binding) Handler(jakarta.xml.ws.handler.Handler) SOAPTestHandler(fromwsdl.handler_simple_rpclit.common.SOAPTestHandler) BindingProvider(jakarta.xml.ws.BindingProvider)

Example 7 with Binding

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

the class ClientServerTestUtil method clearHandlers.

/**
 * Method used to clear any handlers from a stub or dispatch object.
 */
public static void clearHandlers(BindingProvider provider) {
    Binding binding = provider.getBinding();
    binding.setHandlerChain(new ArrayList<Handler>());
}
Also used : Binding(jakarta.xml.ws.Binding) Handler(jakarta.xml.ws.handler.Handler)

Example 8 with Binding

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

the class ClientServerTestUtil method addHandlerToBinding.

/**
 * Method used to add a Handler to a stub or dispatch object.
 */
public static void addHandlerToBinding(Handler handler, BindingProvider bindingProvider) {
    Binding binding = bindingProvider.getBinding();
    List<Handler> handlers = binding.getHandlerChain();
    handlers.add(handler);
    binding.setHandlerChain(handlers);
}
Also used : Binding(jakarta.xml.ws.Binding) Handler(jakarta.xml.ws.handler.Handler)

Example 9 with Binding

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

the class Util method addHandler.

// utility methods to be made available to the test clients
/**
 * Method used to add a Handler to a stub or dispatch object.
 */
public static void addHandler(Handler handler, Object provider) {
    BindingProvider bindingProvider = (BindingProvider) provider;
    Binding binding = bindingProvider.getBinding();
    List<Handler> handlers = binding.getHandlerChain();
    handlers.add(handler);
    binding.setHandlerChain(handlers);
}
Also used : Binding(jakarta.xml.ws.Binding) Handler(jakarta.xml.ws.handler.Handler) BindingProvider(jakarta.xml.ws.BindingProvider)

Example 10 with Binding

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

the class Util method clearHandlers.

/**
 * Method used to clear any handlers from a stub or dispatch object.
 */
public static void clearHandlers(Object provider) {
    BindingProvider bindingProvider = (BindingProvider) provider;
    Binding binding = bindingProvider.getBinding();
    binding.setHandlerChain(new java.util.ArrayList());
}
Also used : Binding(jakarta.xml.ws.Binding) 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