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 Ian Su <ia...@optusnet.com.au> on 2006/09/28 09:06:25 UTC
[Axis 1.4] Arrays Interop with .NET etc
Hi,
I'm having trouble getting arrays of objects to be sent properly from an Axis 1.4 servlet to a .NET client.
In my <wsdl:types> I have:
<xsd:complexType name="Thing">
<xsd:sequence>
<xsd:element name="value" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ArrayOfThing">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" name="item" type="typens:Thing"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="GetThingArrayResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="wrapper" type="typens:ArrayOfThing"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
I then use WSDL2Java to generate the servlet, and then I tried using it against a .NET as well as a gSOAP client. Both doesn't work (always get nothing in the array). The gSOAP client gives out this warning:
Tags 'ns1:value' and 'SOAP-ENV:' match but namespaces differ
Tags 'ns2:value' and 'SOAP-ENV:' match but namespaces differ
Tags 'ns3:value' and 'SOAP-ENV:' match but namespaces differ
The SOAP body that gets sent by the servlet is very weird, with a new namespace definition every array element like this:
<soapenv:Body>
<GetThingArrayResponse xmlns="http://test.ians">
<wrapper xmlns:ns1="http://test.ians" xsi:type="ns1:Thing">
<ns1:value>0</ns1:value>
</wrapper>
<wrapper xmlns:ns2="http://test.ians" xsi:type="ns2:Thing">
<ns2:value>1</ns2:value>
</wrapper>
<wrapper xmlns:ns3="http://test.ians" xsi:type="ns3:Thing">
<ns3:value>2</ns3:value>
</wrapper>
</GetThingArrayResponse>
</soapenv:Body>
However if I don't use the ArrayOfThing type, and put the array definition in the Response element, it works for both .NET and gSOAP clients:
<xsd:element name="GetThingArrayResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" name="item" type="typens:Thing"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
The SOAP body sent by Axis looks normal, like this:
<soapenv:Body>
<GetThingArrayResponse xmlns="http://test.ians">
<item>
<value>0</value>
</item>
<item>
<value>1</value>
</item>
<item>
<value>2</value>
</item>
<item>
<value>3</value>
</item>
</GetThingArrayResponse>
</soapenv:Body>
However I need to be able to define array types besides just in the Resopnse element. I have also tried to follow the example here
http://dinoch.dyndns.org:7070/axis1.2/AboutCtService.jsp
But it doesn't seem to work either.
Any advice would be greatly appreciated!!
Ian.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: [Axis 1.4] Arrays Interop with .NET etc
Posted by Anne Thomas Manes <at...@gmail.com>.
Please file a JIRA.
On 9/28/06, Ian Su <ia...@optusnet.com.au> wrote:
> Hi,
>
> I'm having trouble getting arrays of objects to be sent properly from an Axis 1.4 servlet to a .NET client.
>
> In my <wsdl:types> I have:
>
> <xsd:complexType name="Thing">
> <xsd:sequence>
> <xsd:element name="value" type="xsd:int"/>
> </xsd:sequence>
> </xsd:complexType>
>
> <xsd:complexType name="ArrayOfThing">
> <xsd:sequence>
> <xsd:element maxOccurs="unbounded" name="item" type="typens:Thing"/>
> </xsd:sequence>
> </xsd:complexType>
>
> <xsd:element name="GetThingArrayResponse">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="wrapper" type="typens:ArrayOfThing"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
>
> I then use WSDL2Java to generate the servlet, and then I tried using it against a .NET as well as a gSOAP client. Both doesn't work (always get nothing in the array). The gSOAP client gives out this warning:
>
> Tags 'ns1:value' and 'SOAP-ENV:' match but namespaces differ
> Tags 'ns2:value' and 'SOAP-ENV:' match but namespaces differ
> Tags 'ns3:value' and 'SOAP-ENV:' match but namespaces differ
>
> The SOAP body that gets sent by the servlet is very weird, with a new namespace definition every array element like this:
>
> <soapenv:Body>
> <GetThingArrayResponse xmlns="http://test.ians">
> <wrapper xmlns:ns1="http://test.ians" xsi:type="ns1:Thing">
> <ns1:value>0</ns1:value>
> </wrapper>
> <wrapper xmlns:ns2="http://test.ians" xsi:type="ns2:Thing">
> <ns2:value>1</ns2:value>
> </wrapper>
> <wrapper xmlns:ns3="http://test.ians" xsi:type="ns3:Thing">
> <ns3:value>2</ns3:value>
> </wrapper>
> </GetThingArrayResponse>
> </soapenv:Body>
>
> However if I don't use the ArrayOfThing type, and put the array definition in the Response element, it works for both .NET and gSOAP clients:
>
> <xsd:element name="GetThingArrayResponse">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element maxOccurs="unbounded" name="item" type="typens:Thing"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
>
> The SOAP body sent by Axis looks normal, like this:
>
> <soapenv:Body>
> <GetThingArrayResponse xmlns="http://test.ians">
> <item>
> <value>0</value>
> </item>
> <item>
> <value>1</value>
> </item>
> <item>
> <value>2</value>
> </item>
> <item>
> <value>3</value>
> </item>
> </GetThingArrayResponse>
> </soapenv:Body>
>
> However I need to be able to define array types besides just in the Resopnse element. I have also tried to follow the example here
>
> http://dinoch.dyndns.org:7070/axis1.2/AboutCtService.jsp
>
> But it doesn't seem to work either.
>
> Any advice would be greatly appreciated!!
>
> Ian.
>
> ---------------------------------------------------------------------
> 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