If this doesn't belong on this list, could someone kindly suggest a more appropriate list? Thanks, -- SS

I'm using Axis with XMLBeans as the client to an existing service, and everything is working fine until I try to get data from an array. I get back an element of an interface extending

    org.xmlsoap.schemas.soap.encoding.Array

But this doesn't seem to let me get at the actual data inside the array. Sniffing the SOAP messages assures me that there is in fact data being returned, but the API appears to offer me no way to retrieve it. This must be a simple oversight on my part, but I've been staring at it too long without any insights.

Can someone explain how to get the elements of type MyClass from this array? (More details are below.)

Thanks,

  -- Scott

More details:

The schema in the WSDL contains the following:

    <xs:complexType name="Event">
      <xs:sequence>
         <xs:element name="EventDateTime" type="xs:dateTime"/>
         <xs:element name="EventDescription" type="xs:string"/>
         <xs:element name="EventId" type="xs:long"/>
         <xs:element name="EventTitle" type="xs:string"/>
         <!-- many more fields -->
      </xs:sequence>
    </xs:complexType>

    <xs:complexType name="arEvent">
      <xs:complexContent>
        <xs:restriction base="soapenc:Array">
          <xs:sequence />
          <xs:attribute ref="soapenc:arrayType"
                        n1:arrayType="ro:Event[]"
                        xmlns:n1="http://schemas.xmlsoap.org/wsdl/";
          />
        </xs:restriction>
      </xs:complexContent>
    </xs:complexType>

toString() on the resulting ArEvent object looks like this:

    <xml-fragment
            xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
            xmlns:xsd="http://www.w3.org/2001/XMLSchema";
            xmlns:HNS="http://tempuri.org/";
            xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
            xmlns:dat="Databox"
    >
      <dat:Event>
        <dat:EventDateTime>2005-05-20T20:00:00</dat:EventDateTime>
        <dat:EventDescription>Description here</dat:EventDescription>
        <dat:EventId>1</dat:EventId>
        <dat:EventTitle>The title</dat:EventTitle>
        <!-- more fields -->
      </dat:Event>
      <dat:Event>
        <dat:EventDateTime>2005-05-20T20:00:00</dat:EventDateTime>
        <dat:EventDescription>Description field</dat:EventDescription>
        <dat:EventId>6</dat:EventId>
        <dat:EventTitle>Test event One</dat:EventTitle>
      </dat:Event>
      <!-- many more events -->
    </xml-fragment>

So the data is clearly there. And the class representing the Event is created by the WSDL2Java tool. I just can't figure out how to get at it.

Thanks again.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to