You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Tom Jordahl <to...@macromedia.com> on 2004/01/08 16:05:27 UTC

Map Schema in Axis 1.1 hardwired to string!

Hi all,

I found what seems to be a pretty serious bug in our Map handling.

Here is the Schema that Axis 1.1 generated for a Map:

<complexType name="mapItem">
 <sequence>
  <element name="key" nillable="true" type="xsd:string" /> 
  <element name="value" nillable="true" type="xsd:string" /> 
 </sequence>
</complexType>
<complexType name="Map">
 <sequence>
  <element maxOccurs="unbounded" minOccurs="0" name="item"
type="apachesoap:mapItem" /> 
 </sequence>
 </complexType>


We are hard coding the key and values in Map to be strings!

In Axis 1.0, we generated xsd:anyType elements, which is correct.

This was changed by Dims in the 1.20 revision of the MapSerializer.java,
where he attempted to use a SOAP encoded array to make .NET happy.
--------------------
Revision : 1.20
Date : 2003/3/12 17:49:7
Author : 'dims'
Description :
Fix for Bug 17703 - Java2WSDL creates .Net interop incompatible map type

Notes:
- Uses soapenc:Array
- Tested with .NET Framework SDK 1.1
- See discussion (http://marc.theaimsgroup.com/?t=102650467100001&r=1&w=2)
--------------------


In revision 1.21, Glen mostly changed this back to use a separate sequence
of an independently declared (as opposed to inline) mapItem type.

--------------------
Date : 2003/4/15 0:35:56
Author : 'gdaniels'
Description :
Make serialization match what was originally defined in Apache SOAP/
Axis, with an explicit complexType for MapItems in an attempt to make
.NET happier.
---------------------

I can't believe our users didn't crucify us for breaking this, as all now
all you can use a Map for is strings.  I am going to change this back to
anyType, which should be correct (and .NET shouldn't have any problems
with).  I will attempt to add a test that uses something other than a string
as an entry in a HashMap, assuming we have a test for Maps.


--
Tom Jordahl
Macromedia Server Development