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