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 Jim Stafford <jc...@apl.jhu.edu> on 2004/03/08 05:08:49 UTC

deserializing a Map?

I am trying to create a custom Derserializer to successfully deserialize 
a Map sent to me by a client who built his SOAP by using a stub 
generated by WSDL and using the WSDL generated beans. The server code 
that is trying to deserialize this is trying to deserialize directly 
into a set of externally written beans.

The following represents a call to add Person, where Person has a Map of 
Contacts (a pure get/set Bean) keyed by name. I can understand and 
account for contactNames being nil. The problem is that the client 
didn't seem to supply enough type information within the value element 
of the item to allow the MapDeserializer class to successfully find a 
QName in its ItemHandler context.getTypeFromAttributes(). The only 
information available durintg that call is the "item" localName". The 
result is a SOAPException that states there was no "contacts" field.

Is the problem in the Axis-generated Stub encoding or is it in my 
failure to figure out how to configure the MapDeserializer to 
deserialize something that I know exactly what it is. The item type is 
Contact.

Any hints?
thanks


<?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>
  <addPerson xmlns="urn:SessionRegistrarNS">
   <in0 xmlns="">
    <contactNames xsi:nil="true"/>
    <contacts>
     <item xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:ns1="http://xml.apache.org/xml-soap">
      <key>SomeContactRole</key>
      <value>
       <city>Pasadena</city>
       <email>mail@address.com</email>
       <phone>555-1212</phone>
       <state>Maryland</state>
       <streetAddress>Address2</streetAddress>
       <streetAddress1>Address1</streetAddress1>
       <streetAddress2 xsi:nil="true"/>
       <zip>21122</zip>
      </value>
     </item>
    </contacts>
    <id xsi:nil="true"/>
    <firstName>Dan3</firstName>
    <lastName>Weimer3</lastName>
    <name>Daniel Edward Weimer3</name>
   </in0>
  </addPerson>
 </soapenv:Body>
</soapenv:Envelope>