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

[EMAIL PROTECTED]
Dorm Phone: (410) 516-5974

http://hops.cs.jhu.edu/~boehme/

Reply via email to