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 Yuvraj Waswani <Yu...@tavant.com> on 2003/09/04 14:19:59 UTC

RE: Deserialization at client side

>>I have also
>>registered BeanSerializerFactory, BeanDeserializerFactory using
>>call.register type mapping

1. did you register with the SAME Qname? :--

call.registerTypeMapping(PurchaseOrderResponse.class,new
javax.xml.namespace.QName("urn:DoclitOrder",
"PurchaseOrderResponse"),
org.apache.axis.encoding.ser.BeanSerializerFactory.class, 
org.apache.axis.encoding.ser.BeanSerializerFactory.class)

2. Also, is your method name "PurchaseOrder"? because then, Axis by default
will generate the response
soap packet with the name "PurchaseOrderResponse" which is the same name as
that of your bean and
thus..in conflict. Seems like the SAME namespace is getting registered for
you response message, which is 
also the namespace of your bean...since the response message name
"PurchaseOrderResponse" might be same as
your bean name.

Can you paste the complete wsdl?



-----Original Message-----
From: Dimuthu Leelarathne [mailto:muthulee@vijayaba.cse.mrt.ac.lk]
Sent: Wednesday, September 04, 2002 5:40 PM
To: axis-user@ws.apache.org
Subject: Deserialization at client side 


Hi,

Am I loosing my sense of time or does it actually take two days for my mails
to reach the mailing list?

Thank you  all for your help and patience, but now I run into more problems.

The TCPMonitor shows request and response messages as below.

Request --------------
<soapenv:Body>
  <PurchaseOrder xmlns="urn:DoclitOrder">
   <description xmlns="">Wood carving of an
Elemphant</description>
   <item xmlns="">ER234</item>
   <quantity xmlns="">1</quantity>
  </PurchaseOrder>
 </soapenv:Body>

Response -------------

<soapenv:Body>
  <PurchaseOrderResponse xmlns="urn:DoclitOrder">
   <PurchaseOrderReturn xmlns="">
     Hi you just ordered the item ER234
     Quantity    :: 1
    Description :: Wood carving of an Elephant</PurchaseOrderReturn>
  </PurchaseOrderResponse>


Now I have a problem with client side Deserialization
of the Response. The error message it gives is

org.xml.sax.SAXException: Deserializing parameter 'PurchaseOrderResponse':
could not find deserializer for type {urn:DoclitOrder}PurchaseOrderResponse

I have a PurchaseOrderResponse coded as a bean with one String. I have also
registered BeanSerializerFactory, BeanDeserializerFactory using
call.register type mapping, but it looks like BeanDeserializer is not even
used. (I have given the stack Trace below). What could be the problem ?

Any help is really appriciated.


In the Client I have specified like this ..........

oper.setReturnType(new javax.xml.namespace.QName("urn:DoclitOrder",
"PurchaseOrderResponse"));
oper.setReturnClass(PurchaseOrderResponse.class);
oper.setReturnQName(new javax.xml.namespace.QName("urn:DoclitOrder",
"PurchaseOrderResponse"));

The stack trace is ........

org.xml.sax.SAXException: Deserializing parameter 'PurchaseOrderResponse':
could not find deserializer for type {urn:DoclitOrder}PurchaseOrderResponse
at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:302)
at
org.apache.axis.encoding.DeserializationContextImpl.startElement(Deserializa
tionContextImpl.java:949)
at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198)
at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:
718)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:232)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:346)
at org.apache.axis.client.Call.invoke(Call.java:2234)
at org.apache.axis.client.Call.invoke(Call.java:2133)
at org.apache.axis.client.Call.invoke(Call.java:1656)
at samples.doclit.TestClient.main(TestClient.java:77)


Thank you,
Dimuthu.