MANU SINHA
MANU SINHA

Reputation: 121

Java method exposed as web service using JAX-WS

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

Upvotes: 0

Views: 801

Answers (1)

Buhake Sindi
Buhake Sindi

Reputation: 89169

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.

Upvotes: 1

Related Questions