I recommend that you define your input message element thus:
<element name="listTest">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0"
name="WSObject" type="tns1:WSObject"/>
<element name="field" type="xsd:string"/>
<element name="value" type="xsd:string"/>
</sequence>
</complexType>
</element>
On 1/11/06, Ben Reif <[EMAIL PROTECTED]> wrote:
I'm using Axis 1.3 and I'm trying to figure out how to get my wsdd file and my WSDL to come out correctly. I have a method in my service that has the following method signiture:public WSObject[] listTest(WSObject[] list, String field, String value)Since I have multiple input parameters it is my understanding that I need to use the wrapped / literal style. First, can someone confirm that the following WSDL and SOAP message is really correct for a message with an array and additional parameters?WSDL:<wsdl:definitions targetNamespace="http://CoretestWebServices/service/WSObjectService" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://CoretestWebServices/service/WSObjectService" xmlns:intf="http://CoretestWebServices/service/WSObjectService" xmlns:tns1="http://webservices.test.domain.coretest.ams.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://CoretestWebServices/service/WSObjectService" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://webservices.test.domain.coretest.ams.com"/>
<element name="listTest">
<complexType>
<sequence>
<element name="ArrayOfWSObject" type="tns1:ArrayOfWSObject"/>
<element name="field" type="xsd:string"/>
<element name="value" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="listTestResponse">
<complexType>
<sequence>
<element name="ArrayOfWSObject" type="tns1:ArrayOfWSObject"/>
</sequence>
</complexType>
</element>
</schema>
<schema elementFormDefault="qualified" targetNamespace="http://webservices.test.domain.coretest.ams.com" xmlns="http://www.w3.org/2001/XMLSchema">
<complexType name="ArrayOfWSBaseRelation">
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="WSBaseRelation" type="tns1:WSBaseRelation"/>
</sequence>
</complexType>
<complexType name="ArrayOfWSObject">
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="WSObject" type="tns1:WSObject"/>
</sequence>
</complexType>
<complexType name="WSBaseRelation">
<sequence>
<element name="flag" nillable="true" type="xsd:boolean"/>
<element name="description" nillable="true" type="xsd:string"/>
<element name="code" nillable="true" type="xsd:string"/>
<element name="parentGUID" nillable="false" type="xsd:string"/>
<element name="guid" nillable="false" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="WSObject">
<sequence>
<element name="trackingNumber" nillable="true" type="xsd:int"/>
<element name="viewOnlyCompField" nillable="true" type="xsd:string"/>
<element name="guid" nillable="false" type="xsd:string"/>
<element name="orderDate" nillable="true" type="xsd:dateTime"/>
<element name="stateCode" nillable="true" type="xsd:string"/>
<element name="quantity" nillable="true" type="xsd:int"/>
<element name="shipDate" nillable="true" type="xsd:date"/>
<element name="directRelationTest" nillable="true" type="tns1:ArrayOfWSBaseRelation"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="listTestResponse">
<wsdl:part element="impl:listTestResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="listTestRequest">
<wsdl:part element="impl:listTest" name="parameters"/>
</wsdl:message>
<wsdl:portType name="WSObjectService">
<wsdl:operation name="listTest">
<wsdl:input message="impl:listTestRequest" name="listTestRequest"/>
<wsdl:output message="impl:listTestResponse" name="listTestResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="WSObjectServiceSoapBinding" type="impl:WSObjectService">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="listTest">
<wsdlsoap:operation soapAction="listTest"/>
<wsdl:input name="listTestRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="listTestResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="WSObjectService">
<wsdl:port binding="impl:WSObjectServiceSoapBinding" name="WSObjectService">
<wsdlsoap:address location="http://localhost:7001/CoretestWebServices/service/WSObjectService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>Expected SOAP request:<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<listTest xmlns="http://CoretestWebServices/service/WSObjectService">
<ArrayOfWSObject>
<ns1:WSObject xmlns:ns1="http://webservices.test.domain.coretest.ams.com">
<ns1:trackingNumber>1234567</ns1:trackingNumber>
<ns1:viewOnlyCompField>View only field</ns1:viewOnlyCompField>
<ns1:guid>4355X9YF7731Z</ns1:guid>
<ns1:orderDate>2006-01-11T16:20:12.534Z</ns1:orderDate>
<ns1:stateCode xsi:nil="true"/>
<ns1:quantity>25</ns1:quantity>
<ns1:shipDate xsi:nil="true"/>
<ns1:directRelationTest>
<ns1:WSBaseRelation>
<ns1:flag>true</ns1:flag>
<ns1:description>Description of Base Relation</ns1:description>
<ns1:code>ABC</ns1:code>
<ns1:parentGUID>4355X9YF7731Z</ns1:parentGUID>
<ns1:guid>XYZ091AB745V</ns1:guid>
</ns1:WSBaseRelation>
<ns1:WSBaseRelation>
<ns1:flag>false</ns1:flag>
<ns1:description>Description of Base Relation 2</ns1:description>
<ns1:code>XYZ</ns1:code>
<ns1:parentGUID>4355X9YF7731Z</ns1:parentGUID>
<ns1:guid>Z940T3BV2239</ns1:guid>
</ns1:WSBaseRelation>
</ns1:directRelationTest>
</ns1:WSObject>
<ns2:WSObject xmlns:ns2="http://webservices.test.domain.coretest.ams.com">
<ns2:trackingNumber>1234567</ns2:trackingNumber>
<ns2:viewOnlyCompField>View only field</ns2:viewOnlyCompField>
<ns2:guid>77538BK299V4</ns2:guid>
<ns2:orderDate>2006-01-11T16:20:12.550Z</ns2:orderDate>
<ns2:stateCode xsi:nil="true"/>
<ns2:quantity>25</ns2:quantity>
<ns2:shipDate xsi:nil="true"/>
<ns2:directRelationTest>
<ns2:WSBaseRelation>
<ns2:flag>true</ns2:flag>
<ns2:description>Description of another Base Relation</ns2:description>
<ns2:code>DEF</ns2:code>
<ns2:parentGUID>77538BK299V4</ns2:parentGUID>
<ns2:guid>99999N8J45CX1</ns2:guid>
</ns2:WSBaseRelation>
</ns2:directRelationTest>
</ns2:WSObject>
</ArrayOfWSObject>
<field>quantity</field>
<value>25</value>
</listTest>
</soapenv:Body>
</soapenv:Envelope>Expected SOAP response:<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<listTestResponse xmlns="http://CoretestWebServices/service/WSObjectService">
<ArrayOfWSObject>
<ns1:WSObject xmlns:ns1="http://webservices.test.domain.coretest.ams.com">
<ns1:trackingNumber>1234567</ns1:trackingNumber>
<ns1:viewOnlyCompField>View only field</ns1:viewOnlyCompField>
<ns1:guid>4355X9YF7731Z</ns1:guid>
<ns1:orderDate>2006-01-11T16:20:12.534Z</ns1:orderDate>
<ns1:stateCode xsi:nil="true"/>
<ns1:quantity>25</ns1:quantity>
<ns1:shipDate xsi:nil="true"/>
<ns1:directRelationTest>
<ns1:WSBaseRelation>
<ns1:flag>true</ns1:flag>
<ns1:description>Description of Base Relation</ns1:description>
<ns1:code>ABC</ns1:code>
<ns1:parentGUID>4355X9YF7731Z</ns1:parentGUID>
<ns1:guid>XYZ091AB745V</ns1:guid>
</ns1:WSBaseRelation>
<ns1:WSBaseRelation>
<ns1:flag>false</ns1:flag>
<ns1:description>Description of Base Relation 2</ns1:description>
<ns1:code>XYZ</ns1:code>
<ns1:parentGUID>4355X9YF7731Z</ns1:parentGUID>
<ns1:guid>Z940T3BV2239</ns1:guid>
</ns1:WSBaseRelation>
</ns1:directRelationTest>
</ns1:WSObject>
<ns2:WSObject xmlns:ns2="http://webservices.test.domain.coretest.ams.com">
<ns2:trackingNumber>1234567</ns2:trackingNumber>
<ns2:viewOnlyCompField>View only field</ns2:viewOnlyCompField>
<ns2:guid>77538BK299V4</ns2:guid>
<ns2:orderDate>2006-01-11T16:20:12.550Z</ns2:orderDate>
<ns2:stateCode xsi:nil="true"/>
<ns2:quantity>25</ns2:quantity>
<ns2:shipDate xsi:nil="true"/>
<ns2:directRelationTest>
<ns2:WSBaseRelation>
<ns2:flag>true</ns2:flag>
<ns2:description>Description of another Base Relation</ns2:description>
<ns2:code>DEF</ns2:code>
<ns2:parentGUID>77538BK299V4</ns2:parentGUID>
<ns2:guid>99999N8J45CX1</ns2:guid>
</ns2:WSBaseRelation>
</ns2:directRelationTest>
</ns2:WSObject>
</ArrayOfWSObject>
</listTestResponse>
</soapenv:Body>
</soapenv:Envelope>I can't seem to get the <operation> tag in my wsdd file so that the org.apache.axis.wsdl.fromJava.Emitter generates out the correct WSDL, assuming that the above WSDL is correct. When I manually correct the WSDL and run the Ant wsdl2java task, passing in the serverside="true" argument, I get a generated deploy.wsdd file that contains:<operation name="listTest" qname="operNS:listTest" xmlns:operNS="http://CoretestWebServices/service/WSObjectService" soapAction="listTest" >
<parameter qname="pns:ArrayOfWSObject" xmlns:pns="http://CoretestWebServices/service/WSObjectService" type="tns:ArrayOfWSObject" xmlns:tns="http://webservices.test.domain.coretest.ams.com" mode="INOUT" itemQName="itns:WSObject" xmlns:itns="http://webservices.test.domain.coretest.ams.com"/>
<parameter qname="pns:field" xmlns:pns="http://CoretestWebServices/service/WSObjectService" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
<parameter qname="pns:value" xmlns:pns="http://CoretestWebServices/service/WSObjectService" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
</operation>If a given WSDL is correct and generates this as the correct coresponding <operation>, I'd expect it to work the other way around as well. However, when I add this into my server-config.wsdd file it does not generate the same WSDL file when I run java2wsdl. I've also experienced an excpetion at runtime during serialization of the response where I get:"java.lang.IllegalArgumentException: Illegal argument passed to ParameterDesc.setJavaType. The java type com.ams.coretest.domain.test.webservices.WSObject does not match the mode inout"After debugging the code it appears that Axis is expecting all OUT or INOUT parameters to implement the javax.xml.rpc.holders.Holder interface? Can someone explain what this is and what it's for? There wasn't much in the Axis documentation.Sorry this is so long, but I wanted to give as much info as possible. Thanks in advance if anyone has any advice.Ben
