axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From babloosony <babloos...@gmail.com>
Subject AxisFault: could not find deserializer for type ...
Date Fri, 18 Feb 2005 13:57:52 GMT
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:definitions
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:part element="impl:addSparePartReturn" name="addSparePartReturn"/>

   </wsdl:message>

   <wsdl:message name="addSparePartRequest">

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

   </wsdl:message>

   <wsdl:portType name="SparePartService">

      <wsdl:operation name="addSparePart" parameterOrder="in0">

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

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

      </wsdl:operation>

   </wsdl:portType>

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

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

      <wsdl:operation name="addSparePart">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="addSparePartRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="addSparePartResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="SparePartServiceService">

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

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

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>
-------------------------------------------------------------




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

Mime
View raw message