You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Dave Overbeck <do...@turnkey.com> on 2005/12/21 15:15:24 UTC
error wrapping array?
Hello,
I'm trying to develop a service under 1.3 which returns an array of
structures to a .NET client. It was created using wsdl2java, closely based
on a wsdl from an equivalent service created in .NET. The published wsdl,
wsdd (which I have not edited), and original input wsdl are below. It
returns an array parameter called "dhoar" containing structures called
"Dho".
In the response I see this:
<dhoar>
<dhoar>
<Number>12</Number>
<Name>Aa</Name>
</dhoar>
<dhoar>
<Number>34</Number>
<Name>Bb</Name>
</dhoar>
</dhoar>
which the .NET client sees as having no data (no errors, just no data). The
.NET client returns this:
<dhoar>
<Dho>
<Number>12</Number>
<Name>Aa</Name>
</Dho>
<Dho>
<Number>34</Number>
<Name>Bb</Name>
</Dho>
</dhoar>
which is what I expect. The wsdl looks OK to me, although it does not
contain all the minOccurs and maxOccurs attributes that the .NET wsdl does.
The service also contains a method returning a single structure, which works
fine.
Does anyone have any suggestions as to why the elements are not being named
correctly?
Thanks in advance,
Dave
=== wsdl ===
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://turnkey.com/AxisWS5"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://turnkey.com/AxisWS5"
xmlns:intf="http://turnkey.com/AxisWS5"
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.3
Built on Oct 05, 2005 (05:23:37 EDT)-->
<wsdl:types>
<schema elementFormDefault="qualified"
targetNamespace="http://turnkey.com/AxisWS5"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="getStr">
<complexType>
<sequence>
<element name="dhoar" type="impl:ArrayOfDho"/>
</sequence>
</complexType>
</element>
<complexType name="Dho">
<sequence>
<element name="Number" type="xsd:int"/>
<element maxOccurs="1" minOccurs="0" name="Name" nillable="true"
type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfDho">
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="item"
type="impl:Dho"/>
</sequence>
</complexType>
<element name="getStrResponse">
<complexType>
<sequence>
<element name="getStrResult" type="xsd:int"/>
<element name="dhoar" type="impl:ArrayOfDho"/>
</sequence>
</complexType>
</element>
<element name="strtest">
<complexType>
<sequence>
<element name="dho" type="impl:Dho"/>
</sequence>
</complexType>
</element>
<element name="strtestResponse">
<complexType>
<sequence>
<element name="strtestResult" type="xsd:int"/>
<element name="dho" type="impl:Dho"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="getStrRequest">
<wsdl:part element="impl:getStr" name="parameters"/>
</wsdl:message>
<wsdl:message name="strtestRequest">
<wsdl:part element="impl:strtest" name="parameters"/>
</wsdl:message>
<wsdl:message name="strtestResponse">
<wsdl:part element="impl:strtestResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="getStrResponse">
<wsdl:part element="impl:getStrResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="AxisWS5Soap">
<wsdl:operation name="getStr">
<wsdl:input message="impl:getStrRequest" name="getStrRequest"/>
<wsdl:output message="impl:getStrResponse" name="getStrResponse"/>
</wsdl:operation>
<wsdl:operation name="strtest">
<wsdl:input message="impl:strtestRequest" name="strtestRequest"/>
<wsdl:output message="impl:strtestResponse"
name="strtestResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AxisWS5SoapSoapBinding" type="impl:AxisWS5Soap">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getStr">
<wsdlsoap:operation
soapAction="http://192.168.1.6:8080/axis13/services/AxisWS5/getStr"/>
<wsdl:input name="getStrRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getStrResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="strtest">
<wsdlsoap:operation
soapAction="http://192.168.1.6:8080/axis13/services/AxisWS5/strtest"/>
<wsdl:input name="strtestRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="strtestResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AxisWS5">
<wsdl:port binding="impl:AxisWS5SoapSoapBinding" name="AxisWS5Soap">
<wsdlsoap:address
location="http://192.168.1.6:8080/axis13/services/AxisWS5Soap"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
=== wsdd ===
<deployment
xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="AxisWS5Soap" provider="java:RPC" style="wrapped"
use="literal">
<parameter name="wsdlTargetNamespace"
value="http://turnkey.com/AxisWS5"/>
<parameter name="wsdlServiceElement" value="AxisWS5"/>
<parameter name="schemaQualified" value="http://turnkey.com/AxisWS5"/>
<parameter name="wsdlServicePort" value="AxisWS5Soap"/>
<parameter name="className"
value="com.turnkey.AxisWS5.AxisWS5SoapSkeleton"/>
<parameter name="wsdlPortType" value="AxisWS5Soap"/>
<parameter name="typeMappingVersion" value="1.2"/>
<parameter name="allowedMethods" value="*"/>
<arrayMapping
xmlns:ns="http://turnkey.com/AxisWS5"
qname="ns:ArrayOfDho"
type="java:com.turnkey.AxisWS5.Dho[]"
innerType="cmp-ns:Dho" xmlns:cmp-ns="http://turnkey.com/AxisWS5"
encodingStyle=""
/>
<typeMapping
xmlns:ns="http://turnkey.com/AxisWS5"
qname="ns:Dho"
type="java:com.turnkey.AxisWS5.Dho"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle=""
/>
</service>
</deployment>
=== original input wsdl ===
<?xml version="1.0" encoding="UTF-8"?>
<definitions
targetNamespace="http://turnkey.com/AxisWS5"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:s0="http://turnkey.com/AxisWS5"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/">
<types>
<s:schema
elementFormDefault="qualified"
targetNamespace="http://turnkey.com/AxisWS5">
<s:complexType name="Dho">
<s:sequence>
<s:element maxOccurs="1" minOccurs="1" name="Number"
type="s:int"/>
<s:element maxOccurs="1" minOccurs="0" name="Name"
type="s:string"/>
</s:sequence>
</s:complexType>
<s:complexType name="ArrayOfDho">
<s:sequence>
<s:element
maxOccurs="unbounded"
minOccurs="0"
name="Dho"
nillable="true"
type="s0:Dho"/>
</s:sequence>
</s:complexType>
<s:element name="getStr">
<s:complexType>
<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="dhoar"
type="s0:ArrayOfDho"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getStrResponse">
<s:complexType>
<s:sequence>
<s:element maxOccurs="1" minOccurs="1"
name="getStrResult" type="s:int"/>
<s:element maxOccurs="1" minOccurs="0" name="dhoar"
type="s0:ArrayOfDho"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="strtest">
<s:complexType>
<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="dho"
type="s0:Dho"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="strtestResponse">
<s:complexType>
<s:sequence>
<s:element maxOccurs="1" minOccurs="1"
name="strtestResult" type="s:int"/>
<s:element maxOccurs="1" minOccurs="0" name="dho"
type="s0:Dho"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</types>
<message name="strtestSoapIn">
<part element="s0:strtest" name="parameters"/>
</message>
<message name="getStrSoapIn">
<part element="s0:getStr" name="parameters"/>
</message>
<message name="strtestSoapOut">
<part element="s0:strtestResponse" name="parameters"/>
</message>
<message name="getStrSoapOut">
<part element="s0:getStrResponse" name="parameters"/>
</message>
<portType name="AxisWS5Soap">
<operation name="getStr">
<input message="s0:getStrSoapIn"/>
<output message="s0:getStrSoapOut"/>
</operation>
<operation name="strtest">
<input message="s0:strtestSoapIn"/>
<output message="s0:strtestSoapOut"/>
</operation>
</portType>
<binding name="AxisWS5Soap" type="s0:AxisWS5Soap">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getStr">
<soap:operation
soapAction="http://192.168.1.6:8080/axis13/services/AxisWS5/getStr"
style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="strtest">
<soap:operation
soapAction="http://192.168.1.6:8080/axis13/services/AxisWS5/strtest"
style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="AxisWS5">
<port binding="s0:AxisWS5Soap" name="AxisWS5Soap">
<soap:address
location="http://192.168.1.6:8080/axis13/services/AxisWS5"/>
</port>
</service>
</definitions>
Re: error wrapping array? :VSMail mx5
Posted by Dave Overbeck <do...@turnkey.com>.
Turns out the response I originally posted was from a version of the wsdd
which had the innerType attribute removed. With the innerType I get elements
like this:
<dhoar xsi:type="ns2:Dho" xmlns:ns2="http://turnkey.com/AxisWS5">
<ns2:Number>52</ns2:Number>
<ns2:Name>Bbbbb</ns2:Name>
</dhoar>
Which the client also can't make sense of. Is there any way I can get a
simple array wrapping
<dhoar>
<Dho>
----contents of element
</Dho>
</dhoar>
?
Thanks,
Dave
> Hello,
>
> I'm trying to develop a service under 1.3 which returns an array of
> structures to a .NET client. It was created using wsdl2java, closely based
> on a wsdl from an equivalent service created in .NET. The published wsdl,
> wsdd (which I have not edited), and original input wsdl are below. It
> returns an array parameter called "dhoar" containing structures called
> "Dho".
>
> In the response I see this:
>
> <dhoar>
> <dhoar>
> <Number>12</Number>
> <Name>Aa</Name>
> </dhoar>
> <dhoar>
> <Number>34</Number>
> <Name>Bb</Name>
> </dhoar>
> </dhoar>
>
> which the .NET client sees as having no data (no errors, just no data).
> The .NET client returns this:
>
> <dhoar>
> <Dho>
> <Number>12</Number>
> <Name>Aa</Name>
> </Dho>
> <Dho>
> <Number>34</Number>
> <Name>Bb</Name>
> </Dho>
> </dhoar>
>
> which is what I expect. The wsdl looks OK to me, although it does not
> contain all the minOccurs and maxOccurs attributes that the .NET wsdl
> does. The service also contains a method returning a single structure,
> which works fine.
>
> Does anyone have any suggestions as to why the elements are not being
> named correctly?
>
> Thanks in advance,
> Dave
>
> === wsdl ===
>
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="http://turnkey.com/AxisWS5"
> xmlns:apachesoap="http://xml.apache.org/xml-soap"
> xmlns:impl="http://turnkey.com/AxisWS5"
> xmlns:intf="http://turnkey.com/AxisWS5"
> 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.3
> Built on Oct 05, 2005 (05:23:37 EDT)-->
> <wsdl:types>
> <schema elementFormDefault="qualified"
> targetNamespace="http://turnkey.com/AxisWS5"
> xmlns="http://www.w3.org/2001/XMLSchema">
> <element name="getStr">
> <complexType>
> <sequence>
> <element name="dhoar" type="impl:ArrayOfDho"/>
> </sequence>
> </complexType>
> </element>
> <complexType name="Dho">
> <sequence>
> <element name="Number" type="xsd:int"/>
> <element maxOccurs="1" minOccurs="0" name="Name" nillable="true"
> type="xsd:string"/>
> </sequence>
> </complexType>
> <complexType name="ArrayOfDho">
> <sequence>
> <element maxOccurs="unbounded" minOccurs="0" name="item"
> type="impl:Dho"/>
> </sequence>
> </complexType>
> <element name="getStrResponse">
> <complexType>
> <sequence>
> <element name="getStrResult" type="xsd:int"/>
> <element name="dhoar" type="impl:ArrayOfDho"/>
> </sequence>
> </complexType>
> </element>
> <element name="strtest">
> <complexType>
> <sequence>
> <element name="dho" type="impl:Dho"/>
> </sequence>
> </complexType>
> </element>
> <element name="strtestResponse">
> <complexType>
> <sequence>
> <element name="strtestResult" type="xsd:int"/>
> <element name="dho" type="impl:Dho"/>
> </sequence>
> </complexType>
> </element>
> </schema>
> </wsdl:types>
> <wsdl:message name="getStrRequest">
> <wsdl:part element="impl:getStr" name="parameters"/>
> </wsdl:message>
> <wsdl:message name="strtestRequest">
> <wsdl:part element="impl:strtest" name="parameters"/>
> </wsdl:message>
> <wsdl:message name="strtestResponse">
> <wsdl:part element="impl:strtestResponse" name="parameters"/>
> </wsdl:message>
> <wsdl:message name="getStrResponse">
> <wsdl:part element="impl:getStrResponse" name="parameters"/>
> </wsdl:message>
> <wsdl:portType name="AxisWS5Soap">
> <wsdl:operation name="getStr">
> <wsdl:input message="impl:getStrRequest" name="getStrRequest"/>
> <wsdl:output message="impl:getStrResponse" name="getStrResponse"/>
> </wsdl:operation>
> <wsdl:operation name="strtest">
> <wsdl:input message="impl:strtestRequest" name="strtestRequest"/>
> <wsdl:output message="impl:strtestResponse"
> name="strtestResponse"/>
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="AxisWS5SoapSoapBinding" type="impl:AxisWS5Soap">
> <wsdlsoap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="getStr">
> <wsdlsoap:operation
> soapAction="http://192.168.1.6:8080/axis13/services/AxisWS5/getStr"/>
> <wsdl:input name="getStrRequest">
> <wsdlsoap:body use="literal"/>
> </wsdl:input>
> <wsdl:output name="getStrResponse">
> <wsdlsoap:body use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="strtest">
> <wsdlsoap:operation
> soapAction="http://192.168.1.6:8080/axis13/services/AxisWS5/strtest"/>
> <wsdl:input name="strtestRequest">
> <wsdlsoap:body use="literal"/>
> </wsdl:input>
> <wsdl:output name="strtestResponse">
> <wsdlsoap:body use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="AxisWS5">
> <wsdl:port binding="impl:AxisWS5SoapSoapBinding" name="AxisWS5Soap">
> <wsdlsoap:address
> location="http://192.168.1.6:8080/axis13/services/AxisWS5Soap"/>
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
> === wsdd ===
>
> <deployment
> xmlns="http://xml.apache.org/axis/wsdd/"
> xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
> <service name="AxisWS5Soap" provider="java:RPC" style="wrapped"
> use="literal">
> <parameter name="wsdlTargetNamespace"
> value="http://turnkey.com/AxisWS5"/>
> <parameter name="wsdlServiceElement" value="AxisWS5"/>
> <parameter name="schemaQualified"
> value="http://turnkey.com/AxisWS5"/>
> <parameter name="wsdlServicePort" value="AxisWS5Soap"/>
> <parameter name="className"
> value="com.turnkey.AxisWS5.AxisWS5SoapSkeleton"/>
> <parameter name="wsdlPortType" value="AxisWS5Soap"/>
> <parameter name="typeMappingVersion" value="1.2"/>
> <parameter name="allowedMethods" value="*"/>
> <arrayMapping
> xmlns:ns="http://turnkey.com/AxisWS5"
> qname="ns:ArrayOfDho"
> type="java:com.turnkey.AxisWS5.Dho[]"
> innerType="cmp-ns:Dho" xmlns:cmp-ns="http://turnkey.com/AxisWS5"
> encodingStyle=""
> />
> <typeMapping
> xmlns:ns="http://turnkey.com/AxisWS5"
> qname="ns:Dho"
> type="java:com.turnkey.AxisWS5.Dho"
> serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
> deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
> encodingStyle=""
> />
> </service>
> </deployment>
>
>
> === original input wsdl ===
>
> <?xml version="1.0" encoding="UTF-8"?>
> <definitions
> targetNamespace="http://turnkey.com/AxisWS5"
> xmlns="http://schemas.xmlsoap.org/wsdl/"
> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> xmlns:s="http://www.w3.org/2001/XMLSchema"
> xmlns:s0="http://turnkey.com/AxisWS5"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/">
> <types>
> <s:schema
> elementFormDefault="qualified"
> targetNamespace="http://turnkey.com/AxisWS5">
> <s:complexType name="Dho">
> <s:sequence>
> <s:element maxOccurs="1" minOccurs="1" name="Number"
> type="s:int"/>
> <s:element maxOccurs="1" minOccurs="0" name="Name"
> type="s:string"/>
> </s:sequence>
> </s:complexType>
> <s:complexType name="ArrayOfDho">
> <s:sequence>
> <s:element
> maxOccurs="unbounded"
> minOccurs="0"
> name="Dho"
> nillable="true"
> type="s0:Dho"/>
> </s:sequence>
> </s:complexType>
> <s:element name="getStr">
> <s:complexType>
> <s:sequence>
> <s:element maxOccurs="1" minOccurs="0" name="dhoar"
> type="s0:ArrayOfDho"/>
> </s:sequence>
> </s:complexType>
> </s:element>
> <s:element name="getStrResponse">
> <s:complexType>
> <s:sequence>
> <s:element maxOccurs="1" minOccurs="1"
> name="getStrResult" type="s:int"/>
> <s:element maxOccurs="1" minOccurs="0" name="dhoar"
> type="s0:ArrayOfDho"/>
> </s:sequence>
> </s:complexType>
> </s:element>
> <s:element name="strtest">
> <s:complexType>
> <s:sequence>
> <s:element maxOccurs="1" minOccurs="0" name="dho"
> type="s0:Dho"/>
> </s:sequence>
> </s:complexType>
> </s:element>
> <s:element name="strtestResponse">
> <s:complexType>
> <s:sequence>
> <s:element maxOccurs="1" minOccurs="1"
> name="strtestResult" type="s:int"/>
> <s:element maxOccurs="1" minOccurs="0" name="dho"
> type="s0:Dho"/>
> </s:sequence>
> </s:complexType>
> </s:element>
> </s:schema>
> </types>
> <message name="strtestSoapIn">
> <part element="s0:strtest" name="parameters"/>
> </message>
> <message name="getStrSoapIn">
> <part element="s0:getStr" name="parameters"/>
> </message>
> <message name="strtestSoapOut">
> <part element="s0:strtestResponse" name="parameters"/>
> </message>
> <message name="getStrSoapOut">
> <part element="s0:getStrResponse" name="parameters"/>
> </message>
> <portType name="AxisWS5Soap">
> <operation name="getStr">
> <input message="s0:getStrSoapIn"/>
> <output message="s0:getStrSoapOut"/>
> </operation>
> <operation name="strtest">
> <input message="s0:strtestSoapIn"/>
> <output message="s0:strtestSoapOut"/>
> </operation>
> </portType>
> <binding name="AxisWS5Soap" type="s0:AxisWS5Soap">
> <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> <operation name="getStr">
> <soap:operation
>
> soapAction="http://192.168.1.6:8080/axis13/services/AxisWS5/getStr"
> style="document"/>
> <input>
> <soap:body use="literal"/>
> </input>
> <output>
> <soap:body use="literal"/>
> </output>
> </operation>
> <operation name="strtest">
> <soap:operation
>
> soapAction="http://192.168.1.6:8080/axis13/services/AxisWS5/strtest"
> style="document"/>
> <input>
> <soap:body use="literal"/>
> </input>
> <output>
> <soap:body use="literal"/>
> </output>
> </operation>
> </binding>
> <service name="AxisWS5">
> <port binding="s0:AxisWS5Soap" name="AxisWS5Soap">
> <soap:address
> location="http://192.168.1.6:8080/axis13/services/AxisWS5"/>
> </port>
> </service>
> </definitions>
>
>
>