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 Robert Baruch <au...@zoominternet.net> on 2007/08/15 22:47:29 UTC

Help with array encoding?

Hi all,

I've got some Java classes that look like this:

public class Person
{
	public String name;
}

public class People extends CommonResponse
{
	public Person[] persons;
}

I ran it through Axis 1.4 on Tomcat, using a deploy that has this in it:

<service name="MyService" provider="java:RPC" style="wrapped"  
use="literal">


...and this is part of the WSDL it generates for the service:

<complexType name="People">
   <complexContent>
     <extension base="impl:CommonResponse>
       <sequence>
         <element name="persons" nillable="true"  
type="impl:ArrayOfPerson"/>
       </sequence>
     </extension>
   </complexContent>
</complexType>

<complexType name="ArrayOfPerson">
   <sequence>
     <element maxOccurs="unbounded" minOccurs="0" name="item"  
type="impl:Person"/>
   </sequence>
</complexType>

<complexType name="Person">
   <sequence>
     <element name="name" nillable="true" type="xsd:string"/>
   </sequence>
</complexType>

As far as I can tell, this is a correct description of the array.

In the service, when I return an array of two Persons, Axis generates  
this in the response:

<people>
   <persons>
     <name>George</name>
   </persons>
   <persons>
     <name>Fred</name>
   </persons>
</people>

This doesn't seem right to me. Shouldn't there be just one <persons>  
with a bunch of <item> elements? Is Axis messing up?

Thanks,

--Rob

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org