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 Dimuthu Leelarathne <mu...@vijayaba.cse.mrt.ac.lk> on 2002/09/04 14:09:45 UTC

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.



Re: Deserialization at client side

Posted by Jon Barber <jo...@acm.org>.
Dimuthu Leelarathne wrote:

>Hi,
>
>Am I loosing my sense of time or does it actually take two days for my mails
>to reach the mailing list?
>
>  
>
Actually it is taking 1 year. From your email header :

    Date: Wed, 4 Sep 2002 18:09:45 +0600

I think you need to adjust your system clock.

Regards,

Jon.



Re: Deserialization at client side

Posted by Dimuthu Leelarathne <mu...@vijayaba.cse.mrt.ac.lk>.
Hi,

I am sorry I haven't mentioned that this is a doc\literal service that does not use wsdl.  So if the server sends xsi:types it would not be correct. In this case the client doesn't know what is coming on the wire. That is why I wrote a bean for PurchaseOrderResponse. 

I don't know whether what I do is correct but that is what came into my mind.

Thanks,
Dimuthu.


----- Original Message ----- 
From: "Michael Konietzka" <ko...@schlund.de>
To: <ax...@ws.apache.org>
Sent: Friday, September 05, 2003 12:02 PM
Subject: Re: Deserialization at client side


> On Wed, Sep 04, 2002 at 06:09:45PM +0600, Dimuthu Leelarathne wrote:
> > 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"));
> 
> Hm, 
> maybe it's too early in the morning for me, but why do you care about
> "PurchaseOrderResponse"? This is the "Response" of your RPC, isn't it? 
> You have to deserialize "PurchaseOrderReturn", which is just a String.
> So you can declare "PurchaseOrder" with a return value "String" on server
> side with no more TypeMapping problems.
> 
> 
> Best regards 
>  Michael
> -- 
> Dipl.-Inform. Michael Konietzka  Schlund + Partner AG
> - Development UNIX -             Brauerstraße 48 
>     Webservices                  D-76135 Karlsuhe
> http://www.schlund.de/           Germany
> 
> 

Re: Deserialization at client side

Posted by Michael Konietzka <ko...@schlund.de>.
On Wed, Sep 04, 2002 at 06:09:45PM +0600, Dimuthu Leelarathne wrote:
> 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"));

Hm, 
maybe it's too early in the morning for me, but why do you care about
"PurchaseOrderResponse"? This is the "Response" of your RPC, isn't it? 
You have to deserialize "PurchaseOrderReturn", which is just a String.
So you can declare "PurchaseOrder" with a return value "String" on server
side with no more TypeMapping problems.


Best regards 
 Michael
-- 
Dipl.-Inform. Michael Konietzka  Schlund + Partner AG
- Development UNIX -             Brauerstraße 48 
    Webservices                  D-76135 Karlsuhe
http://www.schlund.de/           Germany