I'm new to web service. I'm writing some simple web services for testing and I have the following questions.
The website here says that JAX-RPC supports array of primitive types. But when I write a simple web service
@WebService
@SOAPBinding(style=Style.RPC)
public interface AddNums {
@WebMethod
public int addNumbers(int[] nums);
}
and generate the client code from wsdl i get the following WS client interface.
@WebMethod
@WebResult(partName = "return")
public int addNumbers(
@WebParam(name = "arg0", partName = "arg0")
IntArray arg0);
It generates IntArray class having the member protected List
public class IntArray {
@XmlElement(nillable = true)
protected List<Integer> item;
Is this how the arrays are supported? 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:
public int addNumbers(
@WebParam(name = "arg0", targetNamespace = "")
List<Integer> arg0);
The int[ ] array in the original service, became List< Integer>
Does this mean that Array type in the web service is always converted to List in the client code generated from wsdl?