我正在使用wsimport从wsdl文件生成web服务类,使用ant build并编写Handler类来生成pdf附件。现在我包括如下例子。有没有办法在生成的存根实现文件
之外定义handles.xml文件配置@WebServiceClient(name =" XXX_OutService",targetNamespace =" xxxxx",wsdlLocation =" xxxx.wsdl") 的 @HandlerChain(文件=" handlers.xml&#34) 公共类TestOutService 扩展服务 {}
答案 0 :(得分:0)
以下是我在在线文档中找到的解决方案。
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.
我将记录完整的例子将很快发布.....