I  am using a JBuilder Java client  (Axis 1.2 I believe ) to send a  complex object containing a HashMap to a WebSphere 6.0 web service. The Map in the SOAP body does not contain the xsi:type attribute for the key and value. When I use a WebSphere client it does. With the JBuilder client,  the WebSphere runtime is passing a corrupted HashMap to the web service. I reported this to WebSphere support and they insist that it is a JBuilder problem and that the xsi:type should be included with the key and value.  I am using a Document/Literal (wrapped) web service.   Is there a way in Axis or JBuilder to tell it include the xsi:type?

Here is how I define the HashMap type in  the WSDL:
-----------------------------------------------------------------------------
 <wsdl:types>
  <schema elementFormDefault="qualified" targetNamespace="http://xml.apache.org/xml-soap"
     xmlns="http://www.w3.org/2001/XMLSchema"       xmlns:impl="http://api.dms.tivoli.com"  
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"       xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <complexType name="Item">
    <all>
     <element name="key" type="xsd:string"/>
     <element name="value" type="xsd:string"/>
    </all>
   </complexType>

   <complexType name="Map">
    <sequence>
     <element maxOccurs="unbounded" minOccurs="0" name="item" type="apachesoap:Item"/>
    </sequence>
   </complexType>
  </schema>

  <schema elementFormDefault="qualified" targetNamespace="http://api.dms.tivoli.com" ........ >
   <import namespace="http://xml.apache.org/xml-soap"/>  
   <import namespace="http://dom.w3c.org"/>  

        <xsd:complexType name="Device">
                <xsd:sequence>
                        <xsd:element name="deviceID" type="xsd:long" />
                        <xsd:element name="deviceName" nillable="true" type="xsd:string" />
                        <xsd:element name="deviceClassName" nillable="true" type="xsd:string" />
                        <xsd:element name="deviceFriendlyName" nillable="true" type="xsd:string" />                                  
                        <xsd:element name="deviceClassAttributesMap" nillable="true" type="apachesoap:Map" />
                                                 ......                      
                </xsd:sequence>
        </xsd:complexType>


Here is the SOAP request:
--------------------------------------
<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>
      <createDevice xmlns="http://api.dms.tivoli.com">
         <device>
            <deviceID>0</deviceID>
            <deviceName>testWsdl1</deviceName>
            <deviceClassName>BaseOMADM</deviceClassName>
            <deviceFriendlyName xsi:nil="true"/>          
           
            <deviceClassAttributesMap>
               <item xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://xml.apache.org/xml-soap" xmlns="">
                  <key>DEVICE_PASSWORD</key>
                  <value>testWsdl1</value>
               </item>
               <item xmlns="">
                  <key>DEVICE_USERNAME</key>
                  <value>testWsdl1</value>
               </item>
               
            </deviceClassAttributesMap>          
         </device>
      </createDevice>
   </soapenv:Body></soapenv:Envelope>


Thank you,
Frank

Reply via email to