Hi Santosh,
You can certainly do a JiBX binding using one of the org.jibx.extras
marshaller/unmarshaller classes for HashMaps. Jibx2Wsdl won't currently
use these to handle HashMaps when starting from Java code, though.
As far as the issue of using a map in the first place, and Anne's
feeling that it's inappropriate in web services... Well, a map (a set of
key-value pairs) is a fundamental data structure of programming. IMHO
there is absolutely nothing wrong with using such key-value pairs in
your XML documents. It *is* important to understand that there's no
standard XML representation for this type of data, but all that means is
that the schema representation of the document won't convey the
semantics of a map. That's hardly an issue unique to maps, though -
schema only deals with values in isolation, so how values relate to each
other is beyond the scope of schema in any case. Just make sure that
whoever uses your service understands what you're intending with the XML
representation and everything is good.
- Dennis
--
Dennis M. Sosnoski
SOA and Web Services in Java
Axis2 Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
Bhojraj, Santosh wrote:
Will it at least work if JIBX is used for data binding ?
-----Original Message-----
From: Deepal Jayasinghe [mailto:[EMAIL PROTECTED]
Sent: Friday, September 28, 2007 9:28 AM
To: [email protected]
Subject: Re: Problem with return HashMap.
Axis2 does not support hasmap in 1.3 release. May be we will provide
that in a future release.
Thanks
Deepal
[EMAIL PROTECTED] wrote:
Hi,
I have simple web service ( Axis2-1.3 ) which has method return
java.util.HashMap:
public class SimpleWebService {
private HashMap<String, String> _map;
public SimpleWebService() {
_map = new HashMap<String, String>();
}
public HashMap<String, String> getMap() {
_map.put("AA", "BB");
_map.put("BB", "BB");
_map.put("CC", "BB");
_map.put("DD", "BB");
_map.put("EE", "BB");
return _map;
}
}
I use RPCServiceClient. Problem occurred when I try obtain values in
HashMap.
>From client I have gotten empty hash map.
Do you have any experience with serialization HashMap or other java
collections ? Do you know where can I find any samples ?
Regards,
----------------------------------------------------------------------
Fajne i smieszne. Zobacz najlepsze filmiki!
http://link.interia.pl/f1bbb
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]