You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Rainer Faller <ra...@innovations.de> on 2001/03/20 14:55:25 UTC

Hashtable

Is it correct that I can send a Hashtable using SOAP 2.1?

I'm trying to get it running, but I need some information and can't
figure out where to get them.

Can somebody give me an example like the one below (with does NOT work):

<hashtable xsi:type="xsd:hashtable">
	<item>
		<key xsi:type="xsd:string">   key01 </key>
		<value xsi:type="xsd:string"> value01 </value>
	</item>
	<item>
		<key xsi:type="xsd:string">   key02 </key>
		<value xsi:type="xsd:string"> value02 </value>
	</item>
</hashtable>

Is it mapped to the Javatype "java.util.Hashtable" ?

Do I need to change something in the Deployment Descriptor?

Thanks

Rainer

Re: Hashtable

Posted by Rainer Faller <ra...@innovations.de>.
I found a solution myself. I had to edit the DeploymentDescriptor file,
but it would be nicer not to add an entry there (like it does work with
strings)

<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:some-uri" qname="x:Hashtable"
             javaType="java.util.Hashtable"        
            
xml2JavaClassName="org.apache.soap.encoding.soapenc.MapSerializer"
            
java2XMLClassName="org.apache.soap.encoding.soapenc.MapSerializer" />

This is how my SOAP Message looks like:

<hash xmlns:ns1="urn:some-uri" xsi:type="ns1:Hashtable">

  <item>
    <key xsi:type="xsd:string">myKey</key>
    <value xsi:type="xsd:string">myValue</value>
  </item>
</hash>

Rainer

Re: Hashtable

Posted by Rainer Faller <ra...@innovations.de>.
I found a solution myself. I had to edit the DeploymentDescriptor file,
but it would be nicer not to add an entry there (like it does work with
strings)

<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:some-uri" qname="x:Hashtable"
             javaType="java.util.Hashtable"        
            
xml2JavaClassName="org.apache.soap.encoding.soapenc.MapSerializer"
            
java2XMLClassName="org.apache.soap.encoding.soapenc.MapSerializer" />

This is how my SOAP Message looks like:

<hash xmlns:ns1="urn:some-uri" xsi:type="ns1:Hashtable">

  <item>
    <key xsi:type="xsd:string">myKey</key>
    <value xsi:type="xsd:string">myValue</value>
  </item>
</hash>

Rainer