You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by nilesh <ni...@slminfotech.com> on 2004/05/31 17:03:41 UTC

Deserializer Error

Hi ,

I am using Apacge SOAP 2.3.1 .I keep getting the following error :

[SOAPException: faultCode=SOAP-ENV:Client; msg=No Deserializer found to deserialize a &apos; http://soap.ejb.businessobjects.a2g.infocorpnow.com:querySessionBean
Return&apos; using encoding style &apos;null&apos;.; targetException=java.lang.IllegalArgumentException:  No Deserializer found to deserialize a 'http://soap.ejb
.businessobjects.a2g.infocorpnow.com:querySessionBeanReturn' using encoding style 'null'.]


But when i c the request and response on the TCPMON utility , itgives the following :

REQUEST :

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:querySessionBean xmlns:ns1="A2GWebServiceBean" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<myrequest xsi:type="xsd:string">&lt;propertyBag&gt;&lt;employeeid&gt;SUPER&lt;/employeeid&gt;&lt;password&gt;MTliMjg3ZGYyM2NkZmJhYjdiYTZmMzJmNTU5ZGNhNTc=&lt;/password&gt;&lt;javaSessionBean&gt;A2G_OrganizationsSB&lt;/javaSessionBean&gt;&lt;function&gt;&lt;readDynamicQuery&gt;&lt;Query dataTag=&quot;Department&quot; maxRecords=&quot;1&quot;/&gt;&lt;/readDynamicQuery&gt;&lt;/function&gt;&lt;/propertyBag&gt;</myrequest>
</ns1:querySessionBean>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>



RESPONSE on TCPMON :


<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><querySessionBeanResponse xmlns="A2GWebServiceBean"><querySessionBeanReturn xmlns="http://soap.ejb.businessobjects.a2g.infocorpnow.com">&lt;ReplyInformation&gt;&lt;ReturnObject&gt;&lt;Department address=&quot;82 Westmorland Street&quot; city=&quot;Fredericton&quot; country=&quot;Canada&quot; departmentid=&quot;SNB&quot; description=&quot;Service New Brunswick&quot; enterpriseid=&quot;PNB&quot; postalcode=&quot;E3B 5G4&quot; province=&quot;New Brunswick&quot;/&gt;&lt;Department address2=&quot; &quot; departmentid=&quot;WEBDEP&quot; description=&quot;Web Department&quot; enterpriseid=&quot;PNB&quot;/&gt;&lt;/ReturnObject&gt;&lt;ErrorObject code=&quot;0&quot; message=&quot;Success&quot;/&gt;&lt;/ReplyInformation&gt;</querySessionBeanReturn></querySessionBeanResponse></soapenv:Body></soapenv:Envelope>


I'm pasting part of my java soap client used for SOAP Requests and Responses :

	org.apache.soap.rpc.Call call = new org.apache.soap.rpc.Call(); 
	call.setTargetObjectURI("A2GWebServiceBean");
	call.setMethodName("querySessionBean");
	call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
			
			org.apache.soap.transport.http.SOAPHTTPConnection conn =  new org.apache.soap.transport.http.SOAPHTTPConnection();
			conn.setUserName("SUPER");
			conn.setPassword("password");
			call.setSOAPTransport(conn);

			org.apache.soap.encoding.SOAPMappingRegistry smr = new SOAPMappingRegistry ();

		StringDeserializer sd = new StringDeserializer ();
             smr.mapTypes (Constants.NS_URI_SOAP_ENC,new QName ("", "querySessionBeanReturn"), null, null, sd);
			 call.getSOAPMappingRegistry();
	


 Below i'm pasting my WSDL file :


<?xml version="1.0" encoding="UTF-8" ?> 
- <wsdl:definitions targetNamespace="http://soap.ejb.businessobjects.a2g.infocorpnow.com" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soap.ejb.businessobjects.a2g.infocorpnow.com" xmlns:intf="http://soap.ejb.businessobjects.a2g.infocorpnow.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:types>
- <schema elementFormDefault="qualified" targetNamespace="http://soap.ejb.businessobjects.a2g.infocorpnow.com" xmlns="http://www.w3.org/2001/XMLSchema">
- <element name="querySessionBean">
- <complexType>
- <sequence>
  <element name="arg_0_0" nillable="true" type="xsd:string" /> 
  </sequence>
  </complexType>
  </element>
- <element name="querySessionBeanResponse">
- <complexType>
- <sequence>
  <element name="querySessionBeanReturn" nillable="true" type="xsd:string" /> 
  </sequence>
  </complexType>
  </element>
  </schema>
  </wsdl:types>
- <wsdl:message name="querySessionBeanRequest">
  <wsdl:part element="impl:querySessionBean" name="parameters" /> 
  </wsdl:message>
+ <wsdl:message name="querySessionBeanResponse">
  <wsdl:part element="impl:querySessionBeanResponse" name="parameters" /> 
  </wsdl:message>
- <wsdl:portType name="A2GWebService">
- <wsdl:operation name="querySessionBean">
  <wsdl:input message="impl:querySessionBeanRequest" name="querySessionBeanRequest" /> 
  <wsdl:output message="impl:querySessionBeanResponse" name="querySessionBeanResponse" /> 
  </wsdl:operation>
  </wsdl:portType>
- <wsdl:binding name="A2GWebServiceBeanSoapBinding" type="impl:A2GWebService">
  <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
- <wsdl:operation name="querySessionBean">
  <wsdlsoap:operation soapAction="" /> 
- <wsdl:input name="querySessionBeanRequest">
  <wsdlsoap:body use="literal" /> 
  </wsdl:input>
- <wsdl:output name="querySessionBeanResponse">
  <wsdlsoap:body use="literal" /> 
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
- <wsdl:service name="A2GWebServiceService">
- <wsdl:port binding="impl:A2GWebServiceBeanSoapBinding" name="A2GWebServiceBean">
  <wsdlsoap:address location="http://aanchal:9080/a2g/services/A2GWebServiceBean" /> 
  </wsdl:port>
  </wsdl:service>
  </wsdl:definitions>



Please help and tell me where i'm goin wrong...
thanx
Nilesh.


RE: Parameter order in servlet call to Axis service?

Posted by Anne Thomas Manes <an...@manes.net>.
Please send Axis-related questions to the Axis-user list.
Axis-user@ws.apache.org 

-----Original Message-----
From: Guido Lemoine [mailto:guido.lemoine@jrc.it] 
Sent: Tuesday, June 01, 2004 3:55 AM
To: soap-user@ws.apache.org
Subject: Parameter order in servlet call to Axis service?

Dear All,

I have defined a simple web service that takes in 3 String parameters
and processes these in a string return (CheckOrder.java). I compile
with the debug option (-g) so that the parameter names are known to
the wsdl. This works OK when called from a stand-alone SOAP client.

When I use the servlet call to the web service, with named parameters
in the FORM input fields, the order of the parameters is reversed 
(test.html).
Any idea why this is? If this is consistent behavior, I can work around it,
but I noticed that the parameter order is confused if used with a service
that takes in more than 10 parameters.

I am using Axis 1.1 under TOMCAT 5.0.18

Thanks,

Guido Lemoine

*** The web service ***

package test;

public class CheckOrder
{
 public String doIt (String a, String b, String c)
 {
   String reply = "The correct order of the parameters is " + a + "; " + 
b + "; " + c;
     return (reply);
 }
}

*** HTML form calling the web service as a servlet ***

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>test axis server</title>
</head>
<body>
<form method=GET action="/axis/services/checkOrder">

<input type="hidden" name = "method" value = "doIt">
<table>
<tr><td>A:</td><td><input type="text" name="a" size="2" 
value="A"></td></tr>
<tr><td>B:</td><td><input type="text" name="b" size="2" 
value="B"></td></tr>
<tr><td>C:</td><td><input type="text" name="c" size="2" 
value="C"></td></tr>
<tr><td colspan=2 align = center><input type=SUBMIT 
value="Submit"></td><tr>
</table>
</form>
</body>

</html>

(alternatively, call directly as a URL)

http://myserver/axis/services/checkOrder?method=doIt&a=A&b=B&c=C

*** SOAP response, notice the reversal of the parameter order ***

<soapenv:Envelope>
-
   <soapenv:Body>
-
   <doItResponse 
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
-
   <doItReturn xsi:type="xsd:string">
The correct order of the parameters is C; B; A
</doItReturn>
</doItResponse>
</soapenv:Body>
</soapenv:Envelope>




Parameter order in servlet call to Axis service?

Posted by Guido Lemoine <gu...@jrc.it>.
Dear All,

I have defined a simple web service that takes in 3 String parameters
and processes these in a string return (CheckOrder.java). I compile
with the debug option (-g) so that the parameter names are known to
the wsdl. This works OK when called from a stand-alone SOAP client.

When I use the servlet call to the web service, with named parameters
in the FORM input fields, the order of the parameters is reversed 
(test.html).
Any idea why this is? If this is consistent behavior, I can work around it,
but I noticed that the parameter order is confused if used with a service
that takes in more than 10 parameters.

I am using Axis 1.1 under TOMCAT 5.0.18

Thanks,

Guido Lemoine

*** The web service ***

package test;

public class CheckOrder
{
 public String doIt (String a, String b, String c)
 {
   String reply = "The correct order of the parameters is " + a + "; " + 
b + "; " + c;
     return (reply);
 }
}

*** HTML form calling the web service as a servlet ***

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>test axis server</title>
</head>
<body>
<form method=GET action="/axis/services/checkOrder">

<input type="hidden" name = "method" value = "doIt">
<table>
<tr><td>A:</td><td><input type="text" name="a" size="2" 
value="A"></td></tr>
<tr><td>B:</td><td><input type="text" name="b" size="2" 
value="B"></td></tr>
<tr><td>C:</td><td><input type="text" name="c" size="2" 
value="C"></td></tr>
<tr><td colspan=2 align = center><input type=SUBMIT 
value="Submit"></td><tr>
</table>
</form>
</body>

</html>

(alternatively, call directly as a URL)

http://myserver/axis/services/checkOrder?method=doIt&a=A&b=B&c=C

*** SOAP response, notice the reversal of the parameter order ***

<soapenv:Envelope>
-
   <soapenv:Body>
-
   <doItResponse 
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
-
   <doItReturn xsi:type="xsd:string">
The correct order of the parameters is C; B; A
</doItReturn>
</doItResponse>
</soapenv:Body>
</soapenv:Envelope>



Re: Deserializer Error

Posted by Scott Nichol <sn...@scottnichol.com>.
This code

 smr.mapTypes (Constants.NS_URI_SOAP_ENC,new QName ("", "querySessionBeanReturn"), null, null, sd);

provides a mapping for an element named querySessionBeanReturn that is not in a namespace.  However, the respone has this tag

 <querySessionBeanReturn xmlns="http://soap.ejb.businessobjects.a2g.infocorpnow.com">,

which specifies a namespace for this element.  You need to provide a mapping like

 smr.mapTypes(Constants.NS_URI_SOAP_ENC,
   new QName("http://soap.ejb.businessobjects.a2g.infocorpnow.com", "querySessionBeanReturn"),
   null, null, sd);

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "nilesh" <ni...@slminfotech.com>
To: <so...@ws.apache.org>
Sent: Monday, May 31, 2004 11:03 AM
Subject: Deserializer Error


> Hi ,
> 
> I am using Apacge SOAP 2.3.1 .I keep getting the following error :
> 
> [SOAPException: faultCode=SOAP-ENV:Client; msg=No Deserializer found to deserialize a &apos; http://soap.ejb.businessobjects.a2g.infocorpnow.com:querySessionBean
> Return&apos; using encoding style &apos;null&apos;.; targetException=java.lang.IllegalArgumentException:  No Deserializer found to deserialize a 'http://soap.ejb
> .businessobjects.a2g.infocorpnow.com:querySessionBeanReturn' using encoding style 'null'.]
> 
> 
> But when i c the request and response on the TCPMON utility , itgives the following :
> 
> REQUEST :
> 
> <?xml version='1.0' encoding='UTF-8'?>
> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <SOAP-ENV:Body>
> <ns1:querySessionBean xmlns:ns1="A2GWebServiceBean" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> <myrequest xsi:type="xsd:string">&lt;propertyBag&gt;&lt;employeeid&gt;SUPER&lt;/employeeid&gt;&lt;password&gt;MTliMjg3ZGYyM2NkZmJhYjdiYTZmMzJmNTU5ZGNhNTc=&lt;/password&gt;&lt;javaSessionBean&gt;A2G_OrganizationsSB&lt;/javaSessionBean&gt;&lt;function&gt;&lt;readDynamicQuery&gt;&lt;Query dataTag=&quot;Department&quot; maxRecords=&quot;1&quot;/&gt;&lt;/readDynamicQuery&gt;&lt;/function&gt;&lt;/propertyBag&gt;</myrequest>
> </ns1:querySessionBean>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
> 
> 
> 
> RESPONSE on TCPMON :
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><querySessionBeanResponse xmlns="A2GWebServiceBean"><querySessionBeanReturn xmlns="http://soap.ejb.businessobjects.a2g.infocorpnow.com">&lt;ReplyInformation&gt;&lt;ReturnObject&gt;&lt;Department address=&quot;82 Westmorland Street&quot; city=&quot;Fredericton&quot; country=&quot;Canada&quot; departmentid=&quot;SNB&quot; description=&quot;Service New Brunswick&quot; enterpriseid=&quot;PNB&quot; postalcode=&quot;E3B 5G4&quot; province=&quot;New Brunswick&quot;/&gt;&lt;Department address2=&quot; &quot; departmentid=&quot;WEBDEP&quot; description=&quot;Web Department&quot; enterpriseid=&quot;PNB&quot;/&gt;&lt;/ReturnObject&gt;&lt;ErrorObject code=&quot;0&quot; message=&quot;Success&quot;/&gt;&lt;/ReplyInformation&gt;</querySessionBeanReturn></querySessionBeanResponse></soapenv:Body></soapenv:Envelope>
> 
> 
> I'm pasting part of my java soap client used for SOAP Requests and Responses :
> 
> org.apache.soap.rpc.Call call = new org.apache.soap.rpc.Call(); 
> call.setTargetObjectURI("A2GWebServiceBean");
> call.setMethodName("querySessionBean");
> call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> 
> org.apache.soap.transport.http.SOAPHTTPConnection conn =  new org.apache.soap.transport.http.SOAPHTTPConnection();
> conn.setUserName("SUPER");
> conn.setPassword("password");
> call.setSOAPTransport(conn);
> 
> org.apache.soap.encoding.SOAPMappingRegistry smr = new SOAPMappingRegistry ();
> 
> StringDeserializer sd = new StringDeserializer ();
>              smr.mapTypes (Constants.NS_URI_SOAP_ENC,new QName ("", "querySessionBeanReturn"), null, null, sd);
> call.getSOAPMappingRegistry();
> 
> 
> 
>  Below i'm pasting my WSDL file :
> 
> 
> <?xml version="1.0" encoding="UTF-8" ?> 
> - <wsdl:definitions targetNamespace="http://soap.ejb.businessobjects.a2g.infocorpnow.com" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soap.ejb.businessobjects.a2g.infocorpnow.com" xmlns:intf="http://soap.ejb.businessobjects.a2g.infocorpnow.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> - <wsdl:types>
> - <schema elementFormDefault="qualified" targetNamespace="http://soap.ejb.businessobjects.a2g.infocorpnow.com" xmlns="http://www.w3.org/2001/XMLSchema">
> - <element name="querySessionBean">
> - <complexType>
> - <sequence>
>   <element name="arg_0_0" nillable="true" type="xsd:string" /> 
>   </sequence>
>   </complexType>
>   </element>
> - <element name="querySessionBeanResponse">
> - <complexType>
> - <sequence>
>   <element name="querySessionBeanReturn" nillable="true" type="xsd:string" /> 
>   </sequence>
>   </complexType>
>   </element>
>   </schema>
>   </wsdl:types>
> - <wsdl:message name="querySessionBeanRequest">
>   <wsdl:part element="impl:querySessionBean" name="parameters" /> 
>   </wsdl:message>
> + <wsdl:message name="querySessionBeanResponse">
>   <wsdl:part element="impl:querySessionBeanResponse" name="parameters" /> 
>   </wsdl:message>
> - <wsdl:portType name="A2GWebService">
> - <wsdl:operation name="querySessionBean">
>   <wsdl:input message="impl:querySessionBeanRequest" name="querySessionBeanRequest" /> 
>   <wsdl:output message="impl:querySessionBeanResponse" name="querySessionBeanResponse" /> 
>   </wsdl:operation>
>   </wsdl:portType>
> - <wsdl:binding name="A2GWebServiceBeanSoapBinding" type="impl:A2GWebService">
>   <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
> - <wsdl:operation name="querySessionBean">
>   <wsdlsoap:operation soapAction="" /> 
> - <wsdl:input name="querySessionBeanRequest">
>   <wsdlsoap:body use="literal" /> 
>   </wsdl:input>
> - <wsdl:output name="querySessionBeanResponse">
>   <wsdlsoap:body use="literal" /> 
>   </wsdl:output>
>   </wsdl:operation>
>   </wsdl:binding>
> - <wsdl:service name="A2GWebServiceService">
> - <wsdl:port binding="impl:A2GWebServiceBeanSoapBinding" name="A2GWebServiceBean">
>   <wsdlsoap:address location="http://aanchal:9080/a2g/services/A2GWebServiceBean" /> 
>   </wsdl:port>
>   </wsdl:service>
>   </wsdl:definitions>
> 
> 
> 
> Please help and tell me where i'm goin wrong...
> thanx
> Nilesh.
> 
>