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 Hari Lakshmanan <ha...@wakesoft.com> on 2004/02/27 00:04:08 UTC
RE: Deserialization question
-----Original Message-----
From: Hari Lakshmanan
Sent: Thursday, February 26, 2004 2:46 PM
To: 'axis-user@ws.apache.org'
Subject: Deserialization question
Hi All,
I am trying different things with custom serialization. In this
process I created a scenario as given below.
There are two classes which needs custom serialization and their
structure are
public class Data {
public String stringMember;
public Float floatMember;
public Data dataMemeber;
}
public class BPEvent {
public String processName;
public HashMap attributes;
...
...
public void setAttribute(String name, Object obj) {
attributes.put(name,obj);
}
public Object getAttribute(String name) {
return attributes.get(name);
}
}
I have created custom serializer/ deserializer for both Data and
Event classes.
I register the same in the client side. I have no problem in
serializing and the serialized data appears as given below
<?xml version="1.0" encoding="UTF-8"?>
<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>
<ns1:method1 xmlns:ns1="urn:myNamespace">
<ns1:testParam xsi:type="xsd:string">this is a
string</ns1:testParam>
<struct href="#id0"/>
</ns1:method1>
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:BPEvent"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="http://encoding.samples">
<processName xsi:type="xsd:string">saveProcess</processName>
<attributes href="#id1"/>
</multiRef>
<multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns3:Map" xmlns:ns3="http://xml.apache.org/xml-soap"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<item>
<key xsi:type="xsd:string">DataMember</key>
<value href="#id2"/>
</item>
</multiRef>
<multiRef id="id2" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns4:data" xmlns:ns4="http://encoding.samples"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<stringMember xsi:type="xsd:string">String
member</stringMember>
<floatMember xsi:type="xsd:float">1.23</floatMember>
<dataMember href="#id3"/>
</multiRef>
<multiRef id="id3" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns5:data" xmlns:ns5="http://encoding.samples"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<stringMember xsi:type="xsd:string">another str
member</stringMember>
<floatMember xsi:type="xsd:float">4.56</floatMember>
<dataMember xsi:nil="true"/>
</multiRef>
</soapenv:Body>
</soapenv:Envelope>
However when I deserialize the above soap message I get
org.xml.sax.SAXException: No deserializer for a
{http://encoding.samples}Data???
This happens when it deserializes the dataMemeber contained
within the Data class.
Any idea why this is happening?
Thanks a lot
__Hari