File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes hashtable or hashmap in a web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "hashtable or hashmap in a web service" Watch "hashtable or hashmap in a web service" New topic

hashtable or hashmap in a web service

Rodrigo Bossini
Ranch Hand

Joined: Jul 03, 2009
Posts: 113

I'm building a C# web service (whatever, that could be in java anyway) and I just realized that I need to send something similar to a hashtable (similar to the hashmap in java) as a response to my web service consumer.

Will that simply work?

As I'm new to the web service world, there might be a trick that I'm not yet aware of.

If it will not work, do you guys have a suggestion on how I could build something similar to a hashtable manually?

Thank you.

I see wind mills
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
If you want to test whether your web service conforms to the WS-I Basic Profile (conformance will facilitate interoperability), then you can use the WS-I testing tool that is embedded in soapUI or that can be downloaded separately to examine the WSDL of your web service.
To be more interoperable, I would use an array of items where each item contains a key and a value. If you have a multi-value hashmap, then each item need to contain a key and a list of values.
Hope this helps!
I agree. Here's the link:
subject: hashtable or hashmap in a web service
It's not a secret anymore!