JAX-WS modifying handler chain programmatically? PortInfo?
- by wuntee
I have a JAX-WS client that needs to have a modified handler-chain. I am currently doing it by binding this XML when generated the WSDL stubs:
<jaxws:bindings xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
<jws:handler-chains xmlns:jws="http://java.sun.com/xml/ns/javaee">
<jws:handler-chain>
<jws:handler>
<jws:handler-name>ServiceRequestServiceClientHandler</jws:handler-name>
<jws:handler-class>blah.ServiceRequestServiceClientHandler</jws:handler-class>
</jws:handler>
</jws:handler-chain>
</jws:handler-chains>
</jaxws:bindings>
I was looking that the ServiceRequestService_Service object, and it seems like this could be done programmatically (easier in my opinion - less configuration files).
new ServiceRequestService_Service().getHandlerResolver().getHandlerChain(PORTINFO).add(HANDLER);
But, I do not know what the PortInfo object is, or how to obtain it in relation to the specific service. Has anyone done this?