Hi Robert,
Here is your updated wsdl which will generate a Record[] &
transid in the TestResponse.
You have to define the Record element separately & then
include that as an array in your TestResponse. Specified in bold below.
<?xml version="1.0"?>
<definitions xmlns:u="http://www.test.com/soap/TestService.wsdl"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns="http://www.w3.org/2001/12/soap-envelope"
xmlns:ns1="http://www.w3.org/2001/XMLSchema"
xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/" name="TestService"
targetNamespace="http://www.test.com/soap/TestService.wsdl">
<types>
<xs:schema xmlns:n1="http://www.test.com/soap"
xmlns:u="http://www.test.com/soap"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.w3.org/2001/12/soap-envelope"
attributeFormDefault="qualified">
<xs:complexType name="Record">
<xs:all>
<xs:element name="Name" type="xs:string"/>
<xs:element name="ID" type="xs:long"/>
<xs:element name="Type" type="xs:string"/>
</xs:all>
</xs:complexType>
<xs:element name="TestResponse">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="records"
type="ns:Record"/>
<xs:element name="transid" use="optional"
type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TestRequest">
<xs:complexType>
<xs:attribute name="transid" use="optional"
type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:attribute name="mustUnderstand" type="xs:byte"/>
</xs:schema>
</types>
<message name="TestInput">
<part name="body" element="ns:TestRequest"/>
</message>
<message name="TestOutput">
<part name="body" element="ns:TestResponse"/>
</message>
<portType name="TestPortType">
<operation name="DoTest">
<input message="u:TestInput"/>
<output message="u:TestOutput"/>
</operation>
</portType>
<binding name="TestSoapBinding" type="u:TestPortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="DoTest">
<soap:operation soapAction="urn:#DoTest"/>
<input>
<soap:body use="literal" message="TestInput"/>
</input>
<output>
<soap:body use="literal" message="TestOutput"/>
</output>
</operation>
</binding>
<service name="TestService">
<documentation>Test</documentation>
<port name="TestServicePort" binding="u:TestSoapBinding">
<soap:address location="http://www.test.com/cgi-bin/soap"/>
</port>
</service>
</definitions>
Thanks
Raghu
________________________________
From: Robert Baruch [mailto:[EMAIL PROTECTED]
Sent: Friday, May 25, 2007 11:48 AM
To: [email protected]
Subject: Problem w/axis 1.4 and array
Yuck, apparently the attachment got flagged as spam by the mail server.
Instead, see this URL for the zip file:
http://chuffyrodents.org/test.zip
Begin forwarded message:
From: Robert Baruch <[EMAIL PROTECTED]>
Date: May 25, 2007 2:28:19 PM EDT
To: [email protected]
Subject: Problem w/axis 1.4 and array
Hi all,
Axis version: 1.4
Java version: 1.5.0
I must be doing something wrong, but I can't figure this out. I've
received a WSDL from a service, and when I pass it through WSDL2Java, I
get no array as expected. I've stripped down the WSDL to just the
essentials.
Basically, I expect this kind of structure as the response message:
TestResponse
Record[]
transid
Instead, I get this:
TestResponse
Record <-- no array!
transid
Can someone look at the WSDL and figure out what stupid thing I did, and
how to fix it? I'm including a zip file containing the test WSDL and the
Java classes generated through WSDL2Java.
Thank you for any help! I'm tearing my hair out!
--Rob