You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by CREMENESCU FLORIN <fl...@cdn.fr> on 2005/03/30 09:56:18 UTC

RE: Howto not mess up response when using Call.setHandler

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


Re: Version Mismatch (Envelope schema)

Posted by Markus Krogemann <ma...@cologne-systems.de>.
Unfortunately, no WSDL exists. The service I am trying to consume
appears to be using a proprietary system and neglecting some standards.
I need to put the SOAPEnvelope together by hand (using Axis classes) and
the server is very picky when it comes to certain namespace declarations
(which are totally legal as far as my XML knowledge is concerned).
Anyway, I am trying to find a solution with the service producer now.

Thanks for your input,
Markus

Anne Thomas Manes wrote:
> Take a look at your WSDL and tell us what the transport attribute in
> the <wsdlsoap:binding> definition says. That will determine which
> version of SOAP Axis is expecting.
> 
> It should say either:
>    transport="http://schemas.xmlsoap.org/soap/http" (SOAP 1.1)
> 
> or 
>    transport="http://www.w3.org/2003/05/soap-envelope" (SOAP 1.2)
> 
> You should not be using any of the pre-standard SOAP 1.2 working draft
> versions, such as
>    transport="http://www.w3.org/2001/12/soap-envelope".
> 
> Anne
> 
>  
> 
> On 5/20/05, Markus Krogemann <ma...@cologne-systems.de> wrote:
> 
>>Dear List,
>>
>>this may well be an often-asked question but I did not find any entries
>>in the FAQ-List or did not look under the right subject, so here goes:
>>
>>>From a webservice server I receive a response envelope starting like this:
>>
>><SOAP-ENV:Envelope
>>xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
>>
>>Now I think the namespace declaration is equivalent to a versioning, right?
>>My application asks Axis to deserialize the response and Axis throws an
>>exception like below. Is there a way to tell Axis how to deal with this
>>kind of response? I am using axis1.1 (have tried 1.2, but same result).
>>
>>It works ok if the response starts like this:
>>
>><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2001/12/soap-envelope">
>>
>>Thanks for any pointers,
>>Markus
>>
>>AxisFault
>> faultCode: {http://schemas.xmlsoap.org/soap/envelope/}VersionMismatch
>> faultSubcode:
>> faultString: Version Mismatch
>> faultActor:
>> faultNode:
>> faultDetail:
>>        {http://xml.apache.org/axis/}stackTrace:Version Mismatch
>>        at
>>org.apache.axis.message.EnvelopeBuilder.startElement(EnvelopeBuilder.java:102)
>>        at
>>org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
>>        at
>>org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
>>        at
>>org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
>>Source)
>>        at
>>org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
>>Source)
>>        at
>>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
>>Source)
>>        at
>>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
>>Source)
>>        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
>>Source)
>>        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
>>Source)

>>        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>>        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>>        at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
>>        at
>>org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
>>        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
>>        at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
>>        at
>>org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
>>        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
>>        at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
>>        at org.apache.axis.client.Call.invoke(Call.java:2748)
>>        at org.apache.axis.client.Call.invoke(Call.java:1902)
>>....
>>
> 
> 
> 

Re: Version Mismatch (Envelope schema)

Posted by Anne Thomas Manes <at...@gmail.com>.
Take a look at your WSDL and tell us what the transport attribute in
the <wsdlsoap:binding> definition says. That will determine which
version of SOAP Axis is expecting.

It should say either:
   transport="http://schemas.xmlsoap.org/soap/http" (SOAP 1.1)

or 
   transport="http://www.w3.org/2003/05/soap-envelope" (SOAP 1.2)

You should not be using any of the pre-standard SOAP 1.2 working draft
versions, such as
   transport="http://www.w3.org/2001/12/soap-envelope".

Anne

 

On 5/20/05, Markus Krogemann <ma...@cologne-systems.de> wrote:
> Dear List,
> 
> this may well be an often-asked question but I did not find any entries
> in the FAQ-List or did not look under the right subject, so here goes:
> 
> From a webservice server I receive a response envelope starting like this:
> 
> <SOAP-ENV:Envelope
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
> 
> Now I think the namespace declaration is equivalent to a versioning, right?
> My application asks Axis to deserialize the response and Axis throws an
> exception like below. Is there a way to tell Axis how to deal with this
> kind of response? I am using axis1.1 (have tried 1.2, but same result).
> 
> It works ok if the response starts like this:
> 
> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2001/12/soap-envelope">
> 
> Thanks for any pointers,
> Markus
> 
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}VersionMismatch
>  faultSubcode:
>  faultString: Version Mismatch
>  faultActor:
>  faultNode:
>  faultDetail:
>         {http://xml.apache.org/axis/}stackTrace:Version Mismatch
>         at
> org.apache.axis.message.EnvelopeBuilder.startElement(EnvelopeBuilder.java:102)
>         at
> org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
>         at
> org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
>         at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> Source)
>         at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
> Source)
>         at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)
>         at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>         at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
>         at
> org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
>         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
>         at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
>         at
> org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
>         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
>         at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
>         at org.apache.axis.client.Call.invoke(Call.java:2748)
>         at org.apache.axis.client.Call.invoke(Call.java:1902)
> ....
>

Version Mismatch (Envelope schema)

Posted by Markus Krogemann <ma...@cologne-systems.de>.
Dear List,

this may well be an often-asked question but I did not find any entries
in the FAQ-List or did not look under the right subject, so here goes:

>From a webservice server I receive a response envelope starting like this:

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

Now I think the namespace declaration is equivalent to a versioning, right?
My application asks Axis to deserialize the response and Axis throws an
exception like below. Is there a way to tell Axis how to deal with this
kind of response? I am using axis1.1 (have tried 1.2, but same result).

It works ok if the response starts like this:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2001/12/soap-envelope">

Thanks for any pointers,
Markus

AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}VersionMismatch
 faultSubcode:
 faultString: Version Mismatch
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}stackTrace:Version Mismatch
        at
org.apache.axis.message.EnvelopeBuilder.startElement(EnvelopeBuilder.java:102)
        at
org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
        at
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
        at
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
        at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
        at
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
        at org.apache.axis.client.Call.invoke(Call.java:2748)
        at org.apache.axis.client.Call.invoke(Call.java:1902)
....