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());
}
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>());
}
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);
}
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);
}
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());
}
Aggregations