views:

38

answers:

1

Hi,

I have got a function with prototype Bean1 fn(Bean2 ) in java. I am trying to expose it as a web service so that same can be called by a .net client or any other. I am using JAX-WS. Both Bean1 and Bean2 have got Hashmap, String and Int type of class variables. Please suggest me as on how to deal with the Bean classes. Isn't hashmap in java not same as in other technologies(if it exists at all).

Am too new to web services, please help!

thanks, Manu

+1  A: 

HashMap is java specific, so if you would want to have a map sent across the network via WS, declare it as an interface Map.

As for Bean1 and Bean2, I suggest you use @XmlElement to map your Bean to the XML Element.

For more, see this.

The Elite Gentleman
I have created two String arrays, One for values and the other one for keys. Is it the correct way ??
MANU SINHA
No, use `java.util.Map` instead of `HashMap`
The Elite Gentleman