I am trying to build a SOAP based webservice which will have Hashmap as input using Java?
Has anyone tried it before? What kind of problems this might cause?
WHat is the best practice for handling input as Hashmap or List?
Thanks for answer.
解决方案
The CXF java_first_jaxws sample:
provides and example on how to "properly" handle Maps (and other interface derived types) with JAX-WS/JAXB. Basically, you have to create a XmlAdapter that will convert the map into types that JAXB can completely map. JAXB will then automatically use those adapters at runtime to map to the types it is happy with. The result it that you have complete control over the resulting schema/wsdl (so you don't have to have the generic "key" and "value" element names) yet also get the convenience of getting to use the Maps.