You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Sagi Mann <sa...@gmail.com> on 2008/09/26 12:45:21 UTC
Lists and arrays as web method parameters
Hi,
I'm attempting to pass either a java ArrayList or some simple array as a web
method param. I've created a test web service with the following 2 methods:
public String testListStringArg(List<String> list) {
return "List " + list.toString();
}
public String testStringArrayArg(String[] array) {
return "Array " + Arrays.asList(array).toString();
}
I deploy the service on the axis2 framework, and look at the WSDL. The List
appears as anyType, and the array appears as list. Is this expected???
Example:
<xs:element name="testListStringArg">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="list" nillable="true"
type="xs:anyType" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="testStringArrayArg">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="array"
nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
On the client side, I'm using wsimport (not wsdl2java, because I don't have
axis2 on the client side), to generate the classes. For the testListString
method, I get an Object parameter, and for the testStringArray method I get
a List<String> parameter (I omitted the @WebParam for clarity):
public String testListStringArg(
Object list);
public String testStringArrayArg(
List<String> array);
This behavior is not the same when I generate a WSDL for a JAXWS web
service, where List remains List and array remains array...
Is this a bug or by design?
thanks.
--
View this message in context: http://www.nabble.com/Lists-and-arrays-as-web-method-parameters-tp19686087p19686087.html
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org