You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Peake, Chris" <CH...@ca.com> on 2002/04/19 22:43:38 UTC

Hashtable return to client (class java.util.HashMap -> class java .util.Hashtable)

I am trying to return a Hashtable object to my Axis generated client but get a
org.xml.sax.SAXException: Bad types (class java.util.HashMap -> class java.util.Hashtable)  org.apache.axis.message.RPCHandler.onStartChild(Unknown Source)  

Glen stated in an earlier message last month:
Well, the MapSerializer is responsible for writing out the <complexType> declaration, and it expects to be writing the "xml-soap:Map" type, since that's the interoperable name for the Map encoding which a bunch of SOAP toolkits support.  This type is automatically mapped in Axis.
--end

So since it implements the Map interface I can return either:
a: HashMap as a HashMap
or: if I really want the Hashtable, return it as a Map.

This works.
Is this then the preferred way?

But, if return type is truly a HashTable, then WSDL is generating <complexTypes> for the HashTable extending Dictionary.  Seems correct but may need a special serializer 'or' the generted client code is assuming a cast which in this case is failing.


Chris Peake