This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Web Services and the fly likes Java Web Service - List vs Array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Java Web Service - List vs Array" Watch "Java Web Service - List vs Array" New topic
Author

Java Web Service - List vs Array

Aravind Jerubandi
Ranch Hand

Joined: Dec 17, 2006
Posts: 49
I'm new to web service. I'm using only Java SDK to create web services.

I'm writing some simple web services for testing and I have the following questions.

I have read that JAX-RPC supports array of primitive types. But when I write a simple web service.



and generate the client code from wsdl i get the following WS client interface.



It generates IntArray class having the member protected List


Is this how the arrays are supported in JAX-RPC? So, the only way to pass the array is to create an instance of IntArray and set List of Integers to it?

Also when i make the webservice to Document style

The WS client interface from WSDL has the following method:



The int[ ] array in the original service, became List< Integer>. Same is the case when i try using String array, it becomes List of String.

Does this mean that Array type in the web service is always converted to List in the client code generated from wsdl?
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Java Web Service - List vs Array
 
It's not a secret anymore!