Anne, I think you're conflating the programming model and the data model here. I know you're doing it in the interest of keeping things simple, but I'm not sure that's a good idea in this case.

XML Schema can describe many representations of hashmaps, such as:

 <map>
   <key>321</key>
   <value>Adam</value>
   <key>492</key>
   <value>Becky</value>
  <map>

or

<map>
<item key="321"><person><first-name>Adam</first-name><last-name>Smith</last-name><address>...</person></item>
<item key="492"><person><first-name>Becky</first-name>...</person></item>
</map>


There's just no one representation that's standard for hashmaps across languages and SOAP platforms. But the whole point of the move to doc/lit is that people need to describe the data they want to exchange in their web services, not the actual program implementations used for handling that data. If you've got a need to use data in the form of key-value pairs in your web service go ahead and do so, but recognize that depending on the framework you use you may need to go through some translation to take this to and from your application data structures. In the case of Axis this can mean converting to and from an array of JavaBeans for the actual data, or using a custom serializer/deserializer, or using data binding in combination with Axis. I don't think it's good to design your web services interfaces around the limitations of the current platform, though (especially since the platforms are all becoming more capable as time goes by).

 - Dennis

Anne Thomas Manes wrote:

Mark,

Designing a WSDL contract refers to the process of designing your SOAP
interface based on the XML messages you intend to exchange (defined using
XML Schema) rather than based on the Java interface of your service agent.


The XML Schema type system doesn't support Hashtables, Maps, Lists, etc,
therefore your service should not expect to exchange these types.


You should define your XML message interface using simple types, structures
of simple types, and arrays of simple types and structures of simple types.
Structures may contain nested structures. In Java, these structures will map
to JavaBeans. They will map to comparable components in other languages.

Anne

-----Original Message-----
From: Mark Chaimungkalanont [mailto:[EMAIL PROTECTED] Sent: Sunday, October 31, 2004 5:44 PM
To: [EMAIL PROTECTED]
Subject: Re: Maximum Interoperability with "Map" objects


I'm quite new to SOAP so I'm not entirely sure what "design WSDL contract" actually entails. Are there any resources out there that you would recommend? I've got a few google hits, but figure that people on this list probably have their "favourite" resources. Is there a collection of such resources somewhare?

Cheers

Mark C

Egor Pervuninski wrote:



Hello,

## Mark Chaimungkalanont : Fri, 29 Oct 2004 17:07:25 +1000

MC> Hi there, I'm writing a SOAP service where interoperability is of
MC> utmost importance. I've read a few of the other posts on this, and
MC> people seem to be saying that Hashtables and the like are not
MC> interoperable. The best strategy seems to be writing a basic
MC> "Entry" bean with key value pairs, using the BeanSerializer and
MC> accepting an Array of them instead of a Map?
MC> MC> Is this the best way to attack the problem?


To achieve maximum interoperability, it is better to design WSDL contract
and create program code from it.

Regards,
Egor Pervuninski
[EMAIL PROTECTED]

Reply via email to