Q: How I have to define @HandlerChain(file="handlers.xml") declaration out of Generated implementation stub class I am using wsimport to generate web service classes from wsdl file by using ant build and writing Handler class to generate pdf attachement. Right now I am including as below example. Is there way to define the handles.xml file configuration out side of generated stub implementaion file
@WebServiceClient(name = "XXX_OutService", targetNamespace = "xxxxx", wsdlLocation = "xxxx.wsdl")
@HandlerChain(file="handlers.xml")
public class TestOutService
    extends Service
{}

A: Here is the solution I have found it  on online documentation.
    BillService webService = new BillService(); // Service Implementation class
    Bill serviceInterface = webService.getHTTPSPort(); // Bill Interface
    BindingProvider provider = (BindingProvider) serviceInterface;
    Binding binding = provider.getBinding();
// override the service level chain
    List<Handler> handlerChain = new ArrayList<Handler>();
    // OR append a handler to the service level chain
    // List<Handler> handlerChain = binding.getHandlerChain();

    handlerChain.add(new BillPdfHandler());
    binding.setHandlerChain(handlerChain);
    // Endpoint url and Add HTTP Basic Authentification credentials to this request goes here.

I will documenting complete examples will post soon.....
