axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sagi Mann <>
Subject Lists and arrays as web method parameters
Date Fri, 26 Sep 2008 10:45:21 GMT

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???

<xs:element name="testListStringArg">
      <xs:element minOccurs="0" name="list" nillable="true"
type="xs:anyType" /> 

<xs:element name="testStringArrayArg">
      <xs:element maxOccurs="unbounded" minOccurs="0" name="array"
nillable="true" type="xs:string" /> 

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?
View this message in context:
Sent from the Axis - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message