File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No Deserializer found to deserialize

 
rajiv sarkar
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am newbie to Apache Soap and am just trying to pass a java bean to my web service and I am getting the below error.
No Deserializer found to deserialize a 'urn:HelloWorldService:helloParam' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'.

I am using Soap 2.2 and apache tomcat 6.0.14.
I have the below deployment descriptor:
<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment" id="urn:HelloWorldService">
<isd rovider type="java" scope="Application" methods="sayHello">
<isd:java class="com.suman.soap.services.hello.HelloWorldService" static="false"/>
</isd rovider>
<isd:mappings>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding"
xmlns:x="urn:HelloWorldService" qname="x:helloParam"
javaType="com.suman.soap.services.hello.Hello"
java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
</isd:mappings>
</isd:service>

And my client code is as follows:
String soapEndPointURL = "http://localhost:8080/SoapPractice/servlet/rpcrouter";
String serviceName = "urn:HelloWorldService";
Response resp = null;
try
{
URL url = new URL(soapEndPointURL);
SOAPMappingRegistry smr = new SOAPMappingRegistry();
BeanSerializer bs = new BeanSerializer();
QName qname = new QName(serviceName, "helloParam");
smr.mapTypes(Constants.NS_URI_SOAP_ENC, qname, Hello.class, bs, bs);
Call call = new Call();
call.setSOAPMappingRegistry(smr);
call.setTargetObjectURI(serviceName);
call.setMethodName("sayHello");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
Vector<Parameter> params = new Vector<Parameter>();
//Create the Hello object
Hello hello = new Hello();
hello.setFirstName("Suman");
hello.setLastName("Maity");
params.addElement(new Parameter("param",Hello.class,hello,null));
call.setParams(params);
resp = call.invoke(url, "");
}
catch(....

I have omitted rest of the error handling code.
I don't know if I am making any mistake. This is driving me crazy. Please help.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Don't use Apache SOAP. Seriously. It's so outdated and obsolete that you can't even download it from ws.apache.org any more, and it's very unlikely that you will get answers to your questions.

If you're just starting out with web services, use Axis 2 instead (http://ws.apache.org/axis2/). The "pojo" example that comes with it demonstrates how to send a simple bean class through SOAP.
 
rajiv sarkar
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulif,
Thanks for the reply. I know that it is obsolete and I had to spend quite some time to download Soap. But in my project there are some web services still running on Apache Soap (Don't know why...looks like no one ever bothered to switch to axis). That's why I need to learn this (if not in detail) just to have some working knowledge so that I can take up enhancements and bug fixes in those web services.
Hence, it will be great if some one can point out at any mistake I am making in the code. This is the bare minimum code that is needed to serialize/deserialize a java bean in apache soap but still I am not able to get through it. Kindly help.
 
Skanda Raman
Ranch Hand
Posts: 205
Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I too have the same problem??

Any help??
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic