title: Developing webservice using Apache Axis2
body: <p>I developed webservice using Apache Axis2 and the WSDL file accepts ArrayList datastructure. However, in the WSDL file it displays the type of the datastructure as follows:</p>
  
  <pre><code>&lt;xs:complexType&gt;
   &lt;xs:sequence&gt;
    &lt;xs:element minOccurs="0" name="myDetails" nillable="true" type="xs:anyType" /&gt; 
   &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;
  </code></pre>
  
  <p>I am trying to generate client class using Apache Axis2 based on my generated WSDL file. I am trying to forward an ArrayList details as follows : </p>
  
  <pre><code>ArrayList&lt;String&gt; myDetails = new ArrayList&lt;String&gt;();
  myDetails.add("param1,param2,param3");
  </code></pre>
  
  <p>And forwarding the above arraylist as myDetails.toArray() for the Client class as follows : </p>
  
  <pre><code>WebserviceStub ws = new WebserviceStub("http://localhost:8080/Service/services");
  CustomerDetails cd = new CustomerDetails();
  cd.setMyDetails(myDetails.toArray());
  CustomerDetailsResponse cds = ws.customerDetails(cd);
  </code></pre>
  
  <p>If I run the above client class as Java Application then it's displaying the following error message : </p>
  
  <pre><code>[INFO] Unable to sendViaPost to url[http://localhost:8080/Service/services/]
  org.apache.axis2.AxisFault: Unknow type can not serialize
      at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
      at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:83)
      at org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:84)
      at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499)
      at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
      at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
      at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
      at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:557)
      at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
      at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
      at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
      at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
      at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:438)
      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
  Caused by: javax.xml.stream.XMLStreamException: Unknow type can not serialize
      at org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(ConverterUtil.java:1456)
      at org.apache.axis2.databinding.ADBDataSource.serialize(ADBDataSource.java:93)
      at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:695)
      at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:563)
      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:874)
      at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:283)
      at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:245)
      at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:193)
      at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:79)
      ... 19 more
  </code></pre>
  
  <p>Can we pass an ArrayList as the parameter to the webservice using Axis2 ? Does it have any limitations ? Any ideas would be greatly appreciated</p>