users@glassfish.java.net

Re: trouble configuring client side handlers

From: Stephen DiMilla <Stephen.Dimilla_at_Sun.COM>
Date: Tue, 07 Feb 2006 08:33:30 -0500

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
>>
>