aspose file tools*
The moose likes Web Services and the fly likes AxisFault: could not find deserializer for type ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "AxisFault: could not find deserializer for type ..." Watch "AxisFault: could not find deserializer for type ..." New topic
Author

AxisFault: could not find deserializer for type ...

Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
Hi All,

I exposed an POJO as web service using AXIS 1.2 RC1, TOMCAT and custom (de)serializers.
When I try to access the web service I am getting an axis
fault "org.xml.sax.SAXException: Deserializing parameter 'in0': could not find deserializer for type {http://chapter5.wroxaxis}SparePartBean"
If anyone is interested I can paste my axis (de)serialzers code.
Please suggest how to make this work ?



axis fault from on client
-------------------------------------------------------------
[java] AxisFault
[java] faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
[java] faultSubcode:
[java] faultString: org.xml.sax.SAXException: Deserializing parameter 'in0': could not find deserializer for type {http://chapter5.wroxaxis}SparePartBean
[java] faultActor:
[java] faultNode:
[java] faultDetail:
[java] {http://xml.apache.org/axis/}hostname:hyddl0337

[java] org.xml.sax.SAXException: Deserializing parameter 'in0': could not find deserializer for type {http://chapter5.wroxaxis}SparePartBean
[java] at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
[java] at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128)
[java] at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1083)
[java] at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1712)
[java] at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
[java] at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
[java] at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
[java] at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
[java] at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667)
[java] at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
[java] at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
[java] at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
[java] at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:226)
[java] at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:645)
[java] at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
[java] at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
[java] at org.apache.axis.client.AxisClient.invoke(AxisClient.java:173)
[java] at org.apache.axis.client.Call.invokeEngine(Call.java:2719)
[java] at org.apache.axis.client.Call.invoke(Call.java:2702)
[java] at org.apache.axis.client.Call.invoke(Call.java:2378)
[java] at org.apache.axis.client.Call.invoke(Call.java:2301)
[java] at org.apache.axis.client.Call.invoke(Call.java:1758)
[java] at wroxaxis.chapter5.SparePartDetailsSerSoapBindingStub.addSparePart(SparePartDetailsSerSoapBindingStub.java:144)
[java] at wroxaxis.chapter5.SparePartDetailsSerClient.main(SparePartDetailsSerClient.java:30)
-------------------------------------------------------------



wsdl
-------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl efinitions targetNamespace="http://localhost:9999/axis/services/SparePartDetailsSer" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://localhost:9999/axis/services/SparePartDetailsSer" xmlns:intf="http://localhost:9999/axis/services/SparePartDetailsSer" xmlns:tns1="http://chapter5.wroxaxis" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.2RC1
Built on Sep 29, 2004 (08:29:40 EDT)-->
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://chapter5.wroxaxis" xmlns="http://www.w3.org/2001/XMLSchema">
<complexType name="SparePartBean">
<sequence>
<element name="description" nillable="true" type="xsd:string"/>
<element name="price" type="xsd:float"/>
<element name="sku" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<element name="in0" type="tns1:SparePartBean"/>
</schema>
<schema elementFormDefault="qualified" targetNamespace="http://localhost:9999/axis/services/SparePartDetailsSer" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://chapter5.wroxaxis"/>
<element name="addSparePartReturn" type="xsd:string"/>
</schema>
</wsdl:types>

<wsdl:message name="addSparePartResponse">

<wsdl art element="impl:addSparePartReturn" name="addSparePartReturn"/>

</wsdl:message>

<wsdl:message name="addSparePartRequest">

<wsdl art element="tns1:in0" name="in0"/>

</wsdl:message>

<wsdl ortType name="SparePartService">

<wsdl peration name="addSparePart" parameterOrder="in0">

<wsdl:input message="impl:addSparePartRequest" name="addSparePartRequest"/>

<wsdl utput message="impl:addSparePartResponse" name="addSparePartResponse"/>

</wsdl peration>

</wsdl ortType>

<wsdl:binding name="SparePartDetailsSerSoapBinding" type="impl:SparePartService">

<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

<wsdl peration name="addSparePart">

<wsdlsoap peration soapAction=""/>

<wsdl:input name="addSparePartRequest">

<wsdlsoap:body use="literal"/>

</wsdl:input>

<wsdl utput name="addSparePartResponse">

<wsdlsoap:body use="literal"/>

</wsdl utput>

</wsdl peration>

</wsdl:binding>

<wsdl:service name="SparePartServiceService">

<wsdl ort binding="impl:SparePartDetailsSerSoapBinding" name="SparePartDetailsSer">

<wsdlsoap:address location="http://localhost:9999/axis/services/SparePartDetailsSer"/>

</wsdl ort>

</wsdl:service>

</wsdl efinitions>
-------------------------------------------------------------




web service java client program
-------------------------------------------------------------
String endpointURL =
"http://localhost:9999/axis/services/SparePartDetailsSer";

String methodName = "addSparePart";

Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress (new java.net.URL (endpointURL));
call.setOperationName (new QName ("http://chapter5.wroxaxis", methodName));

SparePartBean spBean = new SparePartBean();
spBean.setSku ("SKU-114");
spBean.setPrice (50.00f);
spBean.setDescription ("Air Filter Model: 12345");

QName qname = new QName ("http://chapter5.wroxaxis", "SparePartBean");
Class cls = wroxaxis.chapter5.SparePartBean.class;

call.registerTypeMapping (cls, qname, WroxAxisSerializerFactory.class,WroxAxisDeserializerFactory.class);
call.addParameter ("SparePart", qname, ParameterMode.IN);

call.setReturnType (XMLType.XSD_STRING);

Object[] params = new Object[] { spBean };

String result = (String) call.invoke (params);

System.out.println ("The response: " + result);
}
catch (Exception e)
{
System.err.println (e.toString());
}
-------------------------------------------------------------



soap request message
-------------------------------------------------------------
POST /axis/services/SparePartDetailsSer HTTP/1.0

Content-Type: text/xml; charset=utf-8

Accept: application/soap+xml, application/dime, multipart/related, text/*

User-Agent: Axis/1.2RC2

Host: 127.0.0.1:9999

Cache-Control: no-cache

Pragma: no-cache

SOAPAction: ""

Content-Length: 354


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<in0 xmlns="http://chapter5.wroxaxis">
<description>Air Filter Model: 12345</description>
<price>50.0</price>
<sku>SKU-114</sku>
</in0>
</soapenv:Body></soapenv:Envelope>
-------------------------------------------------------------



soap response message
-------------------------------------------------------------
HTTP/1.1 500 Internal Server Error

Content-Type: text/xml;charset=utf-8

Date: Fri, 18 Feb 2005 13:46:27 GMT

Server: Apache-Coyote/1.1

Connection: close



<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>org.xml.sax.SAXException: Deserializing parameter 'in0': could not find deserializer for type {http://chapter5.wroxaxis}SparePartBean</faultstring>
<detail>
<ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">hyddl0337</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body></soapenv:Envelope>
-------------------------------------------------------------





Thanks & Regards,


RR Kumaran
SCJP 1.4
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Kumar saaaabb...
Why you are so fond of changing your display name again and again???
It is better if you keep them unique.
Cheers
Balaji


Spritle Software Blogs
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: AxisFault: could not find deserializer for type ...