axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Morten Olsen" <...@unwire.dk>
Subject RE: Howto not mess up response when using Call.setHandler
Date Mon, 04 Apr 2005 07:29:48 GMT
Hi, 

Thanks Florin for your help. I've rewritten my handler to implement
javax.xml.rpc.handler.Handler and my client works now. 

I'm finishing the last parts of the authentication mechanism we need in the
service. I started on the mechanism, as I understood it to be not yet part
of Axis. Just out of curiosity, does anyone know when/if this will be part
of Axis - 1.2? 

Kind regards,
Morten


-----Original Message-----
From: CREMENESCU FLORIN [mailto:florin.cremenescu@cdn.fr] 
Sent: 1. april 2005 13:38
To: 'axis-user@ws.apache.org'
Subject: RE: Howto not mess up response when using Call.setHandler

Hi, 

 My handler implements javax.xml.rpc.handler.Handler. 

 Florin


> -----Message d'origine-----
> De:	Morten Olsen [SMTP:mol@unwire.dk]
> Date:	vendredi 1 avril 2005 13:40
> À:	axis-user@ws.apache.org
> Objet:	RE: Howto not mess up response when using Call.setHandler
> 
> Hi,
> 
> I'm probably missing something here. 
> 
> The handler I'm implementing extends the BasicHandler class which
> implements
> the Handler interface, and as far as I can tell neither have an init
> method
> that takes a HandlerInfo parameter. 
> 
> Am I to implement this method, and if so what should it do?
> 
> Thanks in advance,
> Morten
> 
> 
> -----Original Message-----
> From: CREMENESCU FLORIN [mailto:florin.cremenescu@cdn.fr] 
> Sent: 1. april 2005 09:51
> To: 'axis-user@ws.apache.org'
> Subject: RE: Howto not mess up response when using Call.setHandler
> 
> Hi, 
> 
>  Verify that your handler class is in your classpath and that it has a
> public empty constructor. If this is true, try to put a breakpoint in the
> axis code HandlerChainImpl class to see why it cannot instantiate your
> handler : 
>   private Handler newHandler(HandlerInfo handlerInfo) {
>         try {
>             Handler handler =  // <-- breakpoint here
>                     (Handler) handlerInfo.getHandlerClass().newInstance();
>             handler.init(handlerInfo);
>             return handler;
>         } catch (Exception ex) {
>             String messageText = Messages.getMessage("NoJAXRPCHandler00",
> handlerInfo.getHandlerClass().toString());
>             throw new JAXRPCException(messageText, ex);
>         }
>     }
> 
> Regards, 
>   Florin
> 
> 
> > -----Message d'origine-----
> > De:	Morten Olsen [SMTP:mol@unwire.dk]
> > Date:	vendredi 1 avril 2005 09:29
> > À:	axis-user@ws.apache.org
> > Objet:	RE: Howto not mess up response when using Call.setHandler
> > 
> > Hi again,
> > 
> >  
> > 
> > Thanks Florin for your answer. When using your code as is, without
> > changing the endpoint (sticking with "piPort") it works, but my handler
> is
> > not called.
> > 
> >  
> > 
> > I'm quite new to Axis, but I figured out to put my own service name as
> the
> > end point in your code. When doing this I get the exception shown below.
> I
> > don't know why, so any explanation or advice will be highly appreciated.
> > 
> >  
> > 
> > Bests,
> > 
> > Morten
> > 
> >  
> > 
> > AxisFault
> > 
> >  faultCode:
> > {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
> > 
> >  faultSubcode: 
> > 
> >  faultString: javax.xml.rpc.JAXRPCException: Unable to create handler of
> > type class dk.unwire.udps.io.ws.client.WsseClientHandler
> > 
> >  faultActor: 
> > 
> >  faultNode: 
> > 
> >  faultDetail: 
> > 
> >       {http://xml.apache.org/axis/}stackTrace:
> > javax.xml.rpc.JAXRPCException: Unable to create handler of type class
> > dk.unwire.udps.io.ws.client.WsseClientHandler
> > 
> >       at
> >
> org.apache.axis.handlers.HandlerChainImpl.newHandler(HandlerChainImpl.java
> > :183)
> > 
> >       at
> >
> org.apache.axis.handlers.HandlerChainImpl.&lt;init&gt;(HandlerChainImpl.ja
> > va:101)
> > 
> >       at
> >
> org.apache.axis.handlers.HandlerInfoChainFactory.createHandlerChain(Handle
> > rInfoChainFactory.java:80)
> > 
> >       at
> >
> org.apache.axis.client.AxisClient.invokeJAXRPCHandlers(AxisClient.java:262
> > )
> > 
> >       at org.apache.axis.client.AxisClient.invoke(AxisClient.java:170)
> > 
> >       at org.apache.axis.client.Call.invokeEngine(Call.java:2564)
> > 
> >       at org.apache.axis.client.Call.invoke(Call.java:2553)
> > 
> >       at org.apache.axis.client.Call.invoke(Call.java:2248)
> > 
> >       at org.apache.axis.client.Call.invoke(Call.java:2171)
> > 
> >       at org.apache.axis.client.Call.invoke(Call.java:1691)
> > 
> >       at
> >
> dk.unwire.udps.io.ws.client.ProfileSoapBindingStub.newProfile(ProfileSoapB
> > indingStub.java:190)
> > 
> >       at
> >
> dk.unwire.udps.io.ws.client.WSClientProfileFactory.newProfile(WSClientProf
> > ileFactory.java:198)
> > 
> >       at WSTest.main(WSTest.java:38)
> > 
> >  
> > 
> >  
> > 
> > javax.xml.rpc.JAXRPCException: Unable to create handler of type class
> > dk.unwire.udps.io.ws.client.WsseClientHandler
> > 
> >       at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
> > 
> >       at org.apache.axis.client.AxisClient.invoke(AxisClient.java:210)
> > 
> >       at org.apache.axis.client.Call.invokeEngine(Call.java:2564)
> > 
> >       at org.apache.axis.client.Call.invoke(Call.java:2553)
> > 
> >       at org.apache.axis.client.Call.invoke(Call.java:2248)
> > 
> >       at org.apache.axis.client.Call.invoke(Call.java:2171)
> > 
> >       at org.apache.axis.client.Call.invoke(Call.java:1691)
> > 
> >       at
> >
> dk.unwire.udps.io.ws.client.ProfileSoapBindingStub.newProfile(ProfileSoapB
> > indingStub.java:190)
> > 
> >       at
> >
> dk.unwire.udps.io.ws.client.WSClientProfileFactory.newProfile(WSClientProf
> > ileFactory.java:198)
> > 
> >       at WSTest.main(WSTest.java:38)
> > 
> > Caused by: javax.xml.rpc.JAXRPCException: Unable to create handler of
> type
> > class dk.unwire.udps.io.ws.client.WsseClientHandler
> > 
> >       at
> >
> org.apache.axis.handlers.HandlerChainImpl.newHandler(HandlerChainImpl.java
> > :183)
> > 
> >       at
> >
> org.apache.axis.handlers.HandlerChainImpl.<init>(HandlerChainImpl.java:101
> > )
> > 
> >       at
> >
> org.apache.axis.handlers.HandlerInfoChainFactory.createHandlerChain(Handle
> > rInfoChainFactory.java:80)
> > 
> >       at
> >
> org.apache.axis.client.AxisClient.invokeJAXRPCHandlers(AxisClient.java:262
> > )
> > 
> >       at org.apache.axis.client.AxisClient.invoke(AxisClient.java:170)
> > 
> >       ... 8 more
> > 
> >  
> > 
> >  
> > 
> >   _____  
> > 
> >  
> > 
> > Hi, 
> >  
> >  You havent't included the stacktrace, but I had also problems in
> defining
> > a
> > handler. The winning code for me was : 
> >                                ArrayList handlersInfo=new ArrayList();
> > 
> >                                HandlerInfo hInfo=new
> > HandlerInfo(SOAPLogHandler.class,null,
> > null);
> >                                handlersInfo.add(hInfo);
> >  
> > _call.getService().getHandlerRegistry().setHandlerChain(new
> > QName("piPort"), handlersInfo);
> >  
> >  
> >  Cheers,
> >     Florin Cremenescu
> >  
> >  
> >  
> > > -----Message d'origine-----
> > > De:       Morten Olsen [SMTP:mol@unwire.dk]
> > > Date:     mercredi 30 mars 2005 09:57
> > > À:         axis-user@ws.apache.org
> > > Objet:    Howto not mess up response when using Call.setHandler
> > > 
> > > Hi all,
> > > 
> > >  
> > > 
> > > I'm trying to implement authentication in my web service. I've changed
> > my
> > > client to include security information in the message by following an
> > > example from <http://axis-wsse.sourceforge.net/>. Essentially, the
> > client
> > > sets up a handler on the call which appends the security information.
> I
> > > haven't changed the server side of things yet, as I wanted to see the
> > > client work first.
> > > 
> > >  
> > > 
> > > When I run my client without setting up the handler everything is fine
> -
> > > and it gets a result back from the server that it can deserialize and
> > > write out. 
> > > 
> > >  
> > > 
> > > When I setup the handler, I can see (with tcpmon) that the security
> > > information is added in the client's message and that the server
> > (ignores
> > > it and) returns a message like in the above case. Unfortunately I'm
> > > getting the below exception when the client gets back the message from
> > the
> > > server.
> > > 
> > >  
> > > 
> > > I'm suspecting that setting up the handler for the request message
> > somehow
> > > messes up the handling of the response. The handler is setup with
> > > Call.setHandler(request, response) which takes both a handler for the
> > > request and the response. A just set the response handler to null - as
> > > this is done in the example I've copied. Does anyone know if this is
> the
> > > correct way, to set up the handler?
> > > 
> > >  
> > > 
> > > Best,
> > > 
> > > Morten
> > > 
> > >  
> > > 
> > >  
> > > 
> > > - Exception:
> > > 
> > > org.xml.sax.SAXException: Deserializing parameter 'newProfileReturn':
> > > could not find deserializer for type
> > > {http://encoding.ws.io.udps.unwire.dk}SerializableProfile
> > > 
> > >       at
> > > org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:302)
> > > 
> > >       at
> > >
> >
> org.apache.axis.encoding.DeserializationContextImpl.startElement(Deseriali
> > > zationContextImpl.java:963)
> > > 
> > >       at
> > >
> >
> org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:19
> > > 8)
> > > 
> > >       at
> > >
> >
> org.apache.axis.message.MessageElement.publishToHandler(MessageElement.jav
> > > a:722)
> > > 
> > >       at
> > > org.apache.axis.message.RPCElement.deserialize(RPCElement.java:233)
> > > 
> > >       at
> > org.apache.axis.message.RPCElement.getParams(RPCElement.java:347)
> > > 
> > >       at org.apache.axis.client.Call.invoke(Call.java:2272)
> > > 
> > >       at org.apache.axis.client.Call.invoke(Call.java:2171)
> > > 
> > >       at org.apache.axis.client.Call.invoke(Call.java:1691)
> > > 
> > >       at
> > >
> >
> dk.unwire.udps.io.ws.client.ProfileSoapBindingStub.newProfile(ProfileSoapB
> > > indingStub.java:182)
> > > 
> > >       at
> > >
> >
> dk.unwire.udps.io.ws.client.WSClientProfileFactory.newProfile(WSClientProf
> > > ileFactory.java:198)
> > > 
> > >       at WSTest.main(WSTest.java:38)
> > > 
> > > - There was an error invoking the web service
> > > 
> > > AxisFault
> > > 
> > >  faultCode:
> > > {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
> > > 
> > >  faultSubcode: 
> > > 
> > >  faultString: org.xml.sax.SAXException: Deserializing parameter
> > > &apos;newProfileReturn&apos;:  could not find deserializer for type
> > > {http://encoding.ws.io.udps.unwire.dk}SerializableProfile
> > > 
> > >  faultActor: 
> > > 
> > >  faultNode: 
> > > 
> > >  faultDetail: 
> > > 
> > >       {http://xml.apache.org/axis/}stackTrace:
> org.xml.sax.SAXException:
> > > Deserializing parameter 'newProfileReturn':  could not find
> deserializer
> > > for type {http://encoding.ws.io.udps.unwire.dk}SerializableProfile
> > > 
> > >       at
> > > org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:302)
> > > 
> > >       at
> > >
> >
> org.apache.axis.encoding.DeserializationContextImpl.startElement(Deseriali
> > > zationContextImpl.java:963)
> > > 
> > >       at
> > >
> >
> org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:19
> > > 8)
> > > 
> > >       at
> > >
> >
> org.apache.axis.message.MessageElement.publishToHandler(MessageElement.jav
> > > a:722)
> > > 
> > >       at
> > > org.apache.axis.message.RPCElement.deserialize(RPCElement.java:233)
> > > 
> > >       at
> > org.apache.axis.message.RPCElement.getParams(RPCElement.java:347)
> > > 
> > >       at org.apache.axis.client.Call.invoke(Call.java:2272)
> > > 
> > >       at org.apache.axis.client.Call.invoke(Call.java:2171)
> > > 
> > >       at org.apache.axis.client.Call.invoke(Call.java:1691)
> > > 
> > >       at
> > >
> >
> dk.unwire.udps.io.ws.client.ProfileSoapBindingStub.newProfile(ProfileSoapB
> > > indingStub.java:182)
> > > 
> > >       at
> > >
> >
> dk.unwire.udps.io.ws.client.WSClientProfileFactory.newProfile(WSClientProf
> > > ileFactory.java:198)
> > > 
> > >       at WSTest.main(WSTest.java:38)
> > > 
> > >  
> > > 
> > >  
> > > 
> > > org.xml.sax.SAXException: Deserializing parameter 'newProfileReturn':
> > > could not find deserializer for type
> > > {http://encoding.ws.io.udps.unwire.dk}SerializableProfile
> > > 
> > >       at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
> > > 
> > >       at org.apache.axis.client.Call.invoke(Call.java:2275)
> > > 
> > >       at org.apache.axis.client.Call.invoke(Call.java:2171)
> > > 
> > >       at org.apache.axis.client.Call.invoke(Call.java:1691)
> > > 
> > >       at
> > >
> >
> dk.unwire.udps.io.ws.client.ProfileSoapBindingStub.newProfile(ProfileSoapB
> > > indingStub.java:182)
> > > 
> > >       at
> > >
> >
> dk.unwire.udps.io.ws.client.WSClientProfileFactory.newProfile(WSClientProf
> > > ileFactory.java:198)
> > > 
> > >       at WSTest.main(WSTest.java:38)
> > > 
> > > Caused by: org.xml.sax.SAXException: Deserializing parameter
> > > 'newProfileReturn':  could not find deserializer for type
> > > {http://encoding.ws.io.udps.unwire.dk}SerializableProfile
> > > 
> > >       at
> > > org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:302)
> > > 
> > >       at
> > >
> >
> org.apache.axis.encoding.DeserializationContextImpl.startElement(Deseriali
> > > zationContextImpl.java:963)
> > > 
> > >       at
> > >
> >
> org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:19
> > > 8)
> > > 
> > >       at
> > >
> >
> org.apache.axis.message.MessageElement.publishToHandler(MessageElement.jav
> > > a:722)
> > > 
> > >       at
> > > org.apache.axis.message.RPCElement.deserialize(RPCElement.java:233)
> > > 
> > >       at
> > org.apache.axis.message.RPCElement.getParams(RPCElement.java:347)
> > > 
> > >       at org.apache.axis.client.Call.invoke(Call.java:2272)
> > > 
> > >       ... 5 more
> > > 
> >  
> >  
> > ----------------------------------------------------
> > Ce message et toutes les pieces jointes (ci-apres le "message") sont
> > confidentiels et etablis a l'intention exclusive de ses destinataires.
> > Toute utilisation ou diffusion non autorisee est interdite.Tout message
> > electronique est susceptible d'alteration.
> > Le CREDIT DU NORD et ses filiales declinent toute responsabilite au
> titre
> > de ce message s'il a ete altere, deforme ou falsifie.
> > This message and any attachments ( the "message") are confidential and
> > intended solely for the addressees.
> > Any unauthorised use or dissemination is prohibited.E-mails are
> > susceptible to alteration.
> > Neither CREDIT DU NORD nor any of its subsidiaries or affiliates shall
> be
> > liable for the message if altered, changed or falsified.
> > ----------------------------------------------------
> > 
> >  
> > 
> 
> 
> ----------------------------------------------------
> Ce message et toutes les pieces jointes (ci-apres le "message") sont
> confidentiels et etablis a l'intention exclusive de ses destinataires.
> Toute utilisation ou diffusion non autorisee est interdite.Tout message
> electronique est susceptible d'alteration.
> Le CREDIT DU NORD et ses filiales declinent toute responsabilite au titre
> de
> ce message s'il a ete altere, deforme ou falsifie.
> This message and any attachments ( the "message") are confidential and
> intended solely for the addressees.
> Any unauthorised use or dissemination is prohibited.E-mails are
> susceptible
> to alteration.
> Neither CREDIT DU NORD nor any of its subsidiaries or affiliates shall be
> liable for the message if altered, changed or falsified.
> ----------------------------------------------------
> 


----------------------------------------------------
Ce message et toutes les pieces jointes (ci-apres le "message") sont
confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite.Tout message
electronique est susceptible d'alteration.
Le CREDIT DU NORD et ses filiales declinent toute responsabilite au titre de
ce message s'il a ete altere, deforme ou falsifie.
This message and any attachments ( the "message") are confidential and
intended solely for the addressees.
Any unauthorised use or dissemination is prohibited.E-mails are susceptible
to alteration.
Neither CREDIT DU NORD nor any of its subsidiaries or affiliates shall be
liable for the message if altered, changed or falsified.
----------------------------------------------------



Mime
View raw message