You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by X X <x1...@hotmail.com> on 2001/08/29 00:10:27 UTC
Client side deserialization
My Apache 2.2 SOAP client is calling a service which returns the following
XML...
...
...
<element name="foo">
<complexType>
<sequence>
<element name="text1" type="string" />
<element name="text2" type="string" />
<element name="text3" type="string" />
</sequence>
</complexType>
</element>
...
...
In order for my client to handle this XML I have...
1. Created a JavaBean called Foo that has the appropriate get/set methods
2. Added new map types to the SOAPMappingRegistry with the following code...
SOAPMappingRegistry smr = new SOAPMappingRegistry();
BeanSerializer beanSerializer = new BeanSerializer();
StringDeserializer stringDeserializer = new StringDeserializer();
smr.mapTypes(Constants.NS_URI_SOAP_ENC,
new QName("", "foo"),
Foo.class,
null,
beanSerializer);
smr.mapTypes(Constants.NS_URI_SOAP_ENC,
new QName("", "text1"),
String.class,
null,
stringDeserializer);
smr.mapTypes(Constants.NS_URI_SOAP_ENC,
new QName("", "text2"),
String.class,
null,
stringDeserializer);
smr.mapTypes(Constants.NS_URI_SOAP_ENC,
new QName("", "text3"),
String.class,
null,
stringDeserializer);
My client works perfectly! However, I am concerned that I need code to set
up map types for the strings. If I do *not* have this code I get
deserialization exceptions like...
No Deserializer found to deserialize a ':text1' using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'
Do I really need to set up map types for strings? It was my understanding
that simple types are handled by the default SOAPMappingRegistry.
Thanks.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
Re: Client side deserialization
Posted by Richard Boehme <bo...@acm.jhu.edu>.
Simple types are handled by SOAP; what about using literal xml encoding
instead of SOAP encoding? What does your XML look like when it comes
across the wire?
--Richard Boehme
On Tue, 28 Aug 2001, X X wrote:
> My Apache 2.2 SOAP client is calling a service which returns the following
> XML...
>
> ...
> ...
> <element name="foo">
> <complexType>
> <sequence>
> <element name="text1" type="string" />
> <element name="text2" type="string" />
> <element name="text3" type="string" />
> </sequence>
> </complexType>
> </element>
> ...
> ...
>
> In order for my client to handle this XML I have...
>
> 1. Created a JavaBean called Foo that has the appropriate get/set methods
>
> 2. Added new map types to the SOAPMappingRegistry with the following code...
>
> SOAPMappingRegistry smr = new SOAPMappingRegistry();
> BeanSerializer beanSerializer = new BeanSerializer();
> StringDeserializer stringDeserializer = new StringDeserializer();
>
> smr.mapTypes(Constants.NS_URI_SOAP_ENC,
> new QName("", "foo"),
> Foo.class,
> null,
> beanSerializer);
>
> smr.mapTypes(Constants.NS_URI_SOAP_ENC,
> new QName("", "text1"),
> String.class,
> null,
> stringDeserializer);
>
> smr.mapTypes(Constants.NS_URI_SOAP_ENC,
> new QName("", "text2"),
> String.class,
> null,
> stringDeserializer);
>
> smr.mapTypes(Constants.NS_URI_SOAP_ENC,
> new QName("", "text3"),
> String.class,
> null,
> stringDeserializer);
>
> My client works perfectly! However, I am concerned that I need code to set
> up map types for the strings. If I do *not* have this code I get
> deserialization exceptions like...
>
> No Deserializer found to deserialize a ':text1' using encoding style
> 'http://schemas.xmlsoap.org/soap/encoding/'
>
> Do I really need to set up map types for strings? It was my understanding
> that simple types are handled by the default SOAPMappingRegistry.
>
> Thanks.
>
>
>
>
>
>
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
--
-- Rich
boehme@hops.cs.jhu.edu
Dorm Phone: (410) 516-5974
http://hops.cs.jhu.edu/~boehme/
Re: Client side deserialization
Posted by Richard Boehme <bo...@acm.jhu.edu>.
Simple types are handled by SOAP; what about using literal xml encoding
instead of SOAP encoding? What does your XML look like when it comes
across the wire?
--Richard Boehme
On Tue, 28 Aug 2001, X X wrote:
> My Apache 2.2 SOAP client is calling a service which returns the following
> XML...
>
> ...
> ...
> <element name="foo">
> <complexType>
> <sequence>
> <element name="text1" type="string" />
> <element name="text2" type="string" />
> <element name="text3" type="string" />
> </sequence>
> </complexType>
> </element>
> ...
> ...
>
> In order for my client to handle this XML I have...
>
> 1. Created a JavaBean called Foo that has the appropriate get/set methods
>
> 2. Added new map types to the SOAPMappingRegistry with the following code...
>
> SOAPMappingRegistry smr = new SOAPMappingRegistry();
> BeanSerializer beanSerializer = new BeanSerializer();
> StringDeserializer stringDeserializer = new StringDeserializer();
>
> smr.mapTypes(Constants.NS_URI_SOAP_ENC,
> new QName("", "foo"),
> Foo.class,
> null,
> beanSerializer);
>
> smr.mapTypes(Constants.NS_URI_SOAP_ENC,
> new QName("", "text1"),
> String.class,
> null,
> stringDeserializer);
>
> smr.mapTypes(Constants.NS_URI_SOAP_ENC,
> new QName("", "text2"),
> String.class,
> null,
> stringDeserializer);
>
> smr.mapTypes(Constants.NS_URI_SOAP_ENC,
> new QName("", "text3"),
> String.class,
> null,
> stringDeserializer);
>
> My client works perfectly! However, I am concerned that I need code to set
> up map types for the strings. If I do *not* have this code I get
> deserialization exceptions like...
>
> No Deserializer found to deserialize a ':text1' using encoding style
> 'http://schemas.xmlsoap.org/soap/encoding/'
>
> Do I really need to set up map types for strings? It was my understanding
> that simple types are handled by the default SOAPMappingRegistry.
>
> Thanks.
>
>
>
>
>
>
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
--
-- Rich
boehme@hops.cs.jhu.edu
Dorm Phone: (410) 516-5974
http://hops.cs.jhu.edu/~boehme/