I should have removed the debugging lines, if I do, it looks like this:
RequestOrderService service = new RequestOrderService();
service.setHandlerResolver(new HandlerResolver() {
public List<Handler> getHandlerChain(PortInfo info) {
List<Handler> handlerList = new ArrayList<Handler>();
handlerList.add(new AddMessageIdHandler());
handlerList.add(new PersistMessageHandler());
return handlerList;
}
});
RequestOrderPort port = service.getRequestOrderPort();
Stephen DiMilla wrote:
> I assume your trying to do this with JAXWS 2.0.
> If so try doing it this way:
>
>
> RequestOrderService service = new RequestOrderService();
>
> TestUtil.logMsg("Programatically registering the client
> side handlers by creating new HandlerResolver.");
> service.setHandlerResolver(new HandlerResolver() {
> public List<Handler> getHandlerChain(PortInfo info) {
> List<Handler> handlerList = new ArrayList<Handler>();
>
> TestUtil.logMsg("----------------------------------------------");
> TestUtil.logMsg("Programmatically registering the
> following service based handlers through the binding");
>
> TestUtil.logMsg("----------------------------------------------");
> TestUtil.logMsg("Add Handlers to HandlerChain");
> handlerList.add(new AddMessageIdHandler());
> handlerList.add(new PersistMessageHandler());
> TestUtil.logMsg("HandlerChainList="+handlerList);
> TestUtil.logMsg("HandlerChain size = " +
> handlerList.size());
> return handlerList;
> }
>
> });
>
> RequestOrderPort port = service.getRequestOrderPort();
>
> Stephen.DiMilla_at_sun.com
>
> --------------------------------
>
> Mark Hansen wrote:
>
>> I'm using the code below to set up client-side handlers. However, my
>> handlers are not getting invoked. I'd appreciate any insights.
>> RequestOrderService service = new RequestOrderService();
>> RequestOrderPort port = service.getRequestOrderPort();
>> List<Handler> handlerChain =
>> ((BindingProvider) port).getBinding().getHandlerChain();
>> handlerChain.add(new AddMessageIdHandler());
>> handlerChain.add(new PersistMessageHandler());
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>