axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen New" <stephen....@objectconnections.com>
Subject RE: Array elements in message do not match the WSDL
Date Mon, 26 Mar 2007 01:37:20 GMT

My apologies...I did not see that my question has already been address in
this mail:
http://marc.info/?l=axis-user&m=116922346015758&w=2

I will follow the approach suggested in that mail.

Cheers,
Stephen.

--
Stephen New
Rules Architect
Object Connections Australia
W. www.objectconnections.com  

> -----Original Message-----
> From: Stephen New [mailto:stephen.new@objectconnections.com] 
> Sent: Monday, 26 March 2007 11:24 AM
> To: axis-user@ws.apache.org
> Subject: Array elements in message do not match the WSDL
> 
> Hi,
> 
> I am developing a Document-Wrapped-Literal web service that 
> accepts parameters that are an object structure which 
> includes an array of an objects which then include a 
> sub-array of objects. Although no observable error occurs 
> when I invoke my service, Axis is generating incorrect XML to 
> represent my sub-array. 
> 
> In a schema in the WSDL, part of the message structure is defined as
> follows:
> ...
>    <complexType name="MyRulesExecutorResponse">
>     <sequence>
>      <element name="commandResults" nillable="true"
> type="impl:ArrayOfMyRulesExecutorCommandResult"/>
>      <element name="responseName" nillable="true" type="xsd:string"/>
>     </sequence>
>    </complexType>
>    <complexType name="ArrayOfMyRulesExecutorCommandResult">
>     <sequence>
>      <element maxOccurs="unbounded" minOccurs="0" name="item"
> type="impl:MyRulesExecutorCommandResult"/>
>     </sequence>
>    </complexType>
> ...
> 
> However, the corresponsing response message portion looks like this:
> ...
>           <executeRequestsReturn>
>                <commandResults>
>                   <commandResults>
>                      <commandName>command1</commandName>
>                   </commandResults>
>                   <commandResults>
>                      <commandName>command2</commandName>
>                   </commandResults>
>                </commandResults>
>                <responseName>request1</responseName>
>             </executeRequestsReturn>
> ...
> 
> The "commandResults" element has a nested element also called 
> "commandResults". In order to match the schema in the WSDL, 
> the sub-element should really be named "item", and the 
> message portion should look like the
> following:
> ...
>           <executeRequestsReturn>
>                <commandResults>
>                   <item>
>                      <commandName>command1</commandName>
>                   </item>
>                   <item>
>                      <commandName>command2</commandName>
>                   </item>
>                </commandResults>
>                <responseName>request1</responseName>
>             </executeRequestsReturn>
> ...
> 
> 
> If I use an Axis-generated Java client, then the response 
> message (to the
> client) is somehow interpreted successfully...even though the 
> message does not match the WSDL!! If I used a .NET-generated 
> C# client, then .NET client is unable to interpret the 
> message and, instead, ignores the non-matching sub-elements.
> 
> Does anyone know why Axis would be generating an incorrect 
> element name when representing this array? I have included 
> the full WSDL and the full SOAP response message below, if 
> this helps anybody to understand why I am experience this problem.
> 
> Thanks!
> Stephen.
> 
> 
> 
> 
> 
> 
> 
> WSDL
> ----
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="StevoeNamespace"
> xmlns:apachesoap="http://xml.apache.org/xml-soap"
> xmlns:impl="StevoeNamespace" xmlns:intf="StevoeNamespace"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <!--WSDL created by Apache Axis version: 1.4Built on Apr 22, 
> 2006 (06:55:48 PDT)-->  <wsdl:types>
>   <schema elementFormDefault="qualified" 
> targetNamespace="StevoeNamespace"
> xmlns="http://www.w3.org/2001/XMLSchema">
>    <element name="executeRequests">
>     <complexType>
>      <sequence>
>       <element maxOccurs="unbounded" name="requests"
> type="impl:MyRulesExecutorRequest"/>
>      </sequence>
>     </complexType>
>    </element>
>    <complexType name="MyRulesExecutorCommand">
>     <sequence>
>      <element name="commandName" nillable="true" type="xsd:string"/>
>     </sequence>
>    </complexType>
>    <complexType name="ArrayOfMyRulesExecutorCommand">
>     <sequence>
>      <element maxOccurs="unbounded" minOccurs="0" name="item"
> type="impl:MyRulesExecutorCommand"/>
>     </sequence>
>    </complexType>
>    <complexType name="MyRulesExecutorRequest">
>     <sequence>
>      <element name="commands" nillable="true"
> type="impl:ArrayOfMyRulesExecutorCommand"/>
>      <element name="requestName" nillable="true" type="xsd:string"/>
>     </sequence>
>    </complexType>
>    <element name="executeRequestsResponse">
>     <complexType>
>      <sequence>
>       <element maxOccurs="unbounded" name="executeRequestsReturn"
> type="impl:MyRulesExecutorResponse"/>
>      </sequence>
>     </complexType>
>    </element>
>    <complexType name="MyRulesExecutorCommandResult">
>     <sequence>
>      <element name="commandName" nillable="true" type="xsd:string"/>
>     </sequence>
>    </complexType>
>    <complexType name="ArrayOfMyRulesExecutorCommandResult">
>     <sequence>
>      <element maxOccurs="unbounded" minOccurs="0" name="item"
> type="impl:MyRulesExecutorCommandResult"/>
>     </sequence>
>    </complexType>
>    <complexType name="MyRulesExecutorResponse">
>     <sequence>
>      <element name="commandResults" nillable="true"
> type="impl:ArrayOfMyRulesExecutorCommandResult"/>
>      <element name="responseName" nillable="true" type="xsd:string"/>
>     </sequence>
>    </complexType>
>   </schema>
>  </wsdl:types>
>    <wsdl:message name="executeRequestsResponse">
>       <wsdl:part element="impl:executeRequestsResponse" 
> name="parameters"/>
>    </wsdl:message>
>    <wsdl:message name="executeRequestsRequest">
>       <wsdl:part element="impl:executeRequests" name="parameters"/>
>    </wsdl:message>
>    <wsdl:portType name="MyRulesExecutor">
>       <wsdl:operation name="executeRequests">
>          <wsdl:input message="impl:executeRequestsRequest"
> name="executeRequestsRequest"/>
>          <wsdl:output message="impl:executeRequestsResponse"
> name="executeRequestsResponse"/>
>       </wsdl:operation>
>    </wsdl:portType>
>    <wsdl:binding name="StevoeExecuteRulesSoapBinding"
> type="impl:MyRulesExecutor">
>       <wsdlsoap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>       <wsdl:operation name="executeRequests">
>          <wsdlsoap:operation soapAction=""/>
>          <wsdl:input name="executeRequestsRequest">
>             <wsdlsoap:body use="literal"/>
>          </wsdl:input>
>          <wsdl:output name="executeRequestsResponse">
>             <wsdlsoap:body use="literal"/>
>          </wsdl:output>
>       </wsdl:operation>
>    </wsdl:binding>
>    <wsdl:service name="MyRulesExecutorService">
>       <wsdl:port binding="impl:StevoeExecuteRulesSoapBinding"
> name="StevoeExecuteRules">
>          <wsdlsoap:address
> location="http://localhost:8380/axis/services/StevoeExecuteRules"/>
>       </wsdl:port>
>    </wsdl:service>
> </wsdl:definitions>
> 
> 
> 
> 
> 
> SOAP Reply Message
> ------------------
> 
> <?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>
>          <executeRequestsResponse xmlns="StevoeNamespace">
>             <executeRequestsReturn>
>                <commandResults>
>                   <commandResults>
>                      <commandName>command1</commandName>
>                   </commandResults>
>                   <commandResults>
>                      <commandName>command2</commandName>
>                   </commandResults>
>                </commandResults>
>                <responseName>request1</responseName>
>             </executeRequestsReturn>
>             <executeRequestsReturn>
>                <commandResults>
>                   <commandResults>
>                      <commandName>commandX</commandName>
>                   </commandResults>
>                   <commandResults>
>                      <commandName>commandY</commandName>
>                   </commandResults>
>                </commandResults>
>                <responseName>request2</responseName>
>             </executeRequestsReturn>
>          </executeRequestsResponse>
>       </soapenv:Body>
>    </soapenv:Envelope>
> 
> 
> 
> 
> 
> 
> 
> 
> --
> Stephen New
> Rules Architect
> Object Connections Australia
> W. www.objectconnections.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> >
> 

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


Mime
View raw message