• No replies
1 Post

Pinned topic Using Collections/Generics in JAX-WS web service

‏2012-09-16T02:44:59Z |
Hi all,

My first question in this forums :)

I will be creating a new Web-Service using JAX-WS using RSA 7.5 and WebSPhere 7. Earlier, we created web service with JAX-RPC where we can't use Collections framework(ArrayList, HashMap,etc)/Generics since it was based on Java 4. In that case we used array of models mainly for fulfilling our job. But since for new development work, JAX-WS is preferred and it includes Java 5 features especially the Generics and Annotations.

Now my question is if I use the generics/collections then how will some client such as .Net application and Mainframe Application access it? They are not aware of any Java ArrayList/HAshmap. Hence does it have some restrictions in using collections/ArrayList with proper Generics in JAX-RPC web service?

Of course, if the client is a Java Application then it will be fine. But what about others?

Take this sample code as for example:

//This is the method present in my service class to be used by the client:

public DetailResponse getDetails(DetailRequest request){
//DetailResponse contains a ArrayList<Employee> member variable to be eturned as response to the client.
//For JAX_RPC, it would have been an array of Employee

1) Is this a valid code in JAX-WS? (Reading the doc, I believe the answer is Yes). Then how will .Net and MAinframe application access the above arrayList?

2) Are there some limitations in using these since I have to design the entire thing accordingly based on it.

Please suggest.