Return an array of objects

From: Mariano Garcia <>
Date: Wed, 07 Sep 2005 11:21:03 +0200


But my problem is how I have to make construct messages or objects
between client and server. For example, following the W3C note example,
if I have defined an array of custom objects:

<simpleType name="phoneNumber" base="string"/>

<element name="ArrayOfPhoneNumbers">
  <complexType base="SOAP-ENC:Array">
    <element name="phoneNumber" type="tns:phoneNumber"

This schema defines an array of 'phoneNumber' objects. Then, whe define
an operation that returns a message that includes an array:

<message name="getPhoneNumbersResponse">
      <part element="impl:ArrayOfPhoneNumbers" name="alarmList"/>

<wsdl:portType name="myWebService">
      <wsdl:operation name="getPhoneNumbers">
         <wsdl:input message="impl:getPhoneNumbersRequest"
         <wsdl:output message="impl:getPhoneNumbersResponse"

So, my question is how I have to contruct this message from server side.
wsxompile generates an implementation class like this:

public class myWebService_Impl implements
tests.webservices.server.myWebService, java.rmi.Remote {
    public javax.xml.soap.SOAPElement getPhoneNumbers(<<parameters>>)
         java.rmi.RemoteException {
            List phoneList = <<stuff to get all the phone numbers>>
        javax.xml.soap.SOAPElement _retVal = <<stuff to generate a
SOAPElement object using phoneList object>>;

        return _retVal;

I suppose I have to play with SOAPElement class... doesn't it? How??

Mariano García González :: Analista Programador
Entel IT Consulting, SA
Tlf.    91 567 07 36
Mobile. 619 08 70 90