You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by Glen Daniels <gd...@allaire.com> on 2000/08/10 22:22:07 UTC

MapSerializer + VectorSerializer

Quite a while ago, there was discussion on the SOAP list at develop.com
about how to represent standard mapping types such as are found in Java,
Perl, Python, etc.  There was no firm consensus, but I liked the solution
which looked like this:

<thing xmlns:xmlsoap="http://xml.apache.org/xml-soap"
xsi:type="xmlsoap:Map">
<item>
 <key xsi:type="xsd:string">Key 1</key>
 <value xsi:type="xsd:int">534</value>
</item>
<item>
 <key xsi:type="xsd:string">Key 2</key>
 <value xsi:type="xmlsoap:Map">
  <item>
   <key xsi:type="xsd:string">Inner Key</key>
   <value xsi:type="xsd:string">inner value</value>
  </item>
 </value>
</item>
</thing>

I have hence written a MapSerializer which gets mapped to Hashtable and Map
in SOAPEncodingRegistry, and serializes the mapping types just this way.
What do people think of this encoding (including the new 'standard' type
"xmlsoap:Map")?  If there are no objections, I'd like to commit the changes
tomorrow sometime.

On another related note, while I was implementing "required headers"
functionality (i.e. specify in the DeploymentDescriptor that a given service
must receive certain headers or fail with a SOAP.Client fault), I found
myself serializing and deserializing Vectors.  As it stands, the
VectorSerializer spits out a standard SOAP Array, which deserializes to an
Object[].  This isn't really so hot in the long run, because sometimes you
really want a Vector back so you don't have to manually do an
Object[]->Vector conversion.  So... I'd like to introduce an xmlsoap:Vector
type, and have the VectorSerializer switch to using that.  There could also
be an option to allow serializing to regular Arrays as well, for
flexibility.

Thoughts?

Glen Daniels
Allaire Corp
Engineering Manager
http://www.allaire.com/
                                Building cool stuff for web developers