You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Tom Jordahl <to...@macromedia.com> on 2004/11/18 20:44:20 UTC

2D array problem with .NET

All,

Now that I have changed Axis to remember the arrayType specified in WSDL and
pass that along to the ArraySerializer, we hit another problem with .NET
which arguably is its fault, not ours.  I am not 100% sure about how soap
encoded arrays should work, so I wanted to run the situation by all of you
and see if you think Axis should change (again) so this will work.

Given the following Schema in the .NET WSDL:

<wsdl:types>
    <s:schema targetNamespace="http://tempuri.org/">
      <s:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <s:import namespace="http://schemas.xmlsoap.org/wsdl/" />
      <s:complexType name="ArrayOfArrayOfString">
        <s:complexContent mixed="false">
          <s:restriction base="soapenc:Array">
            <s:attribute wsdl:arrayType="tns:ArrayOfString[]"
ref="soapenc:arrayType" />
          </s:restriction>
        </s:complexContent>
      </s:complexType>
      <s:complexType name="ArrayOfString">
        <s:complexContent mixed="false">
          <s:restriction base="soapenc:Array">
            <s:attribute wsdl:arrayType="s:string[]" ref="soapenc:arrayType"
/>
          </s:restriction>
        </s:complexContent>
      </s:complexType>
    </s:schema>
  </wsdl:types>


We produce the following 2 dimensional array serialization:

<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>
        <ns1:echo2dArray
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://tempuri.org/">
            <my2d soapenc:arrayType="ns1:ArrayOfString[][3]"
xsi:type="soapenc:Array"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
                <item soapenc:arrayType="xsd:string[3]"
xsi:type="soapenc:Array">
                    <item xsi:type="xsd:string">one one</item>
                    <item xsi:type="xsd:string">one two</item>
                    <item xsi:type="xsd:string">one three</item>
                </item>
                <item soapenc:arrayType="xsd:string[3]"
xsi:type="soapenc:Array">
                    <item xsi:type="xsd:string">two one</item>
                    <item xsi:type="xsd:string">two two</item>
                    <item xsi:type="xsd:string">two three</item>
                </item>
                <item soapenc:arrayType="xsd:string[3]"
xsi:type="soapenc:Array">
                    <item xsi:type="xsd:string">three one</item>
                    <item xsi:type="xsd:string">three two</item>
                    <item xsi:type="xsd:string">three three</item>
                </item>
            </my2d>
        </ns1:echo2dArray>
    </soapenv:Body>
</soapenv:Envelope>


I think this is correct per the WSDL, but .NET says:

      <faultcode>soap:Client</faultcode>
      <faultstring>Server was unable to read request. --&gt; There is an
error in XML document (1, 638). --&gt; Object cannot be stored in an array
of this type.</faultstring>


Thoughts?
--
Tom Jordahl
Macromedia Server Development


RE: 2D array problem with .NET

Posted by Glen Daniels <gl...@thoughtcraft.com>.
Tom: 

I think this is us, actually.  We should be either sending:

<my2d soapenc:arrayType="ns1:ArrayOfString[]"...>
  <item xsi:type="ns1:ArrayOfString" soapenc:arrayType="xsd:string[3]"...>

or:

<my2d soapenc:arrayType="xsd:string[][3]"

but not:

<my2d soapenc:arrayType="ns1:ArrayOfString[][3]"

That implies a multi-dimensional array of ArrayOfStrings. :(

--Glen


> -----Original Message-----
> From: Tom Jordahl [mailto:tomj@macromedia.com] 
> Sent: Thursday, November 18, 2004 2:44 PM
> To: 'axis-dev@ws.apache.org'
> Cc: 'Glen Daniels'
> Subject: 2D array problem with .NET
> 
> All,
> 
> Now that I have changed Axis to remember the arrayType 
> specified in WSDL and pass that along to the ArraySerializer, 
> we hit another problem with .NET which arguably is its fault, 
> not ours.  I am not 100% sure about how soap encoded arrays 
> should work, so I wanted to run the situation by all of you 
> and see if you think Axis should change (again) so this will work.
> 
> Given the following Schema in the .NET WSDL:
> 
> <wsdl:types>
> 
>     <s:schema targetNamespace="http://tempuri.org/">
> 
>       <s:import 
> namespace="http://schemas.xmlsoap.org/soap/encoding/" />
> 
>       <s:import namespace="http://schemas.xmlsoap.org/wsdl/" />
> 
>       <s:complexType name="ArrayOfArrayOfString">
> 
>         <s:complexContent mixed="false">
> 
>           <s:restriction base="soapenc:Array">
> 
>             <s:attribute wsdl:arrayType="tns:ArrayOfString[]" 
> ref="soapenc:arrayType" />
> 
>           </s:restriction>
> 
>         </s:complexContent>
> 
>       </s:complexType>
> 
>       <s:complexType name="ArrayOfString">
> 
>         <s:complexContent mixed="false">
> 
>           <s:restriction base="soapenc:Array">
> 
>             <s:attribute wsdl:arrayType="s:string[]" 
> ref="soapenc:arrayType" />
> 
>           </s:restriction>
> 
>         </s:complexContent>
> 
>       </s:complexType>
> 
>     </s:schema>
> 
>   </wsdl:types>
> 
> 
> We produce the following 2 dimensional array serialization:
> 
> <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>
> 
>         <ns1:echo2dArray 
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encodin
> g/" xmlns:ns1="http://tempuri.org/">
> 
>             <my2d soapenc:arrayType="ns1:ArrayOfString[][3]" 
> xsi:type="soapenc:Array" 
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
> 
>                 <item soapenc:arrayType="xsd:string[3]" 
> xsi:type="soapenc:Array">
> 
>                     <item xsi:type="xsd:string">one one</item>
> 
>                     <item xsi:type="xsd:string">one two</item>
> 
>                     <item xsi:type="xsd:string">one three</item>
> 
>                 </item>
> 
>                 <item soapenc:arrayType="xsd:string[3]" 
> xsi:type="soapenc:Array">
> 
>                     <item xsi:type="xsd:string">two one</item>
> 
>                     <item xsi:type="xsd:string">two two</item>
> 
>                     <item xsi:type="xsd:string">two three</item>
> 
>                 </item>
> 
>                 <item soapenc:arrayType="xsd:string[3]" 
> xsi:type="soapenc:Array">
> 
>                     <item xsi:type="xsd:string">three one</item>
> 
>                     <item xsi:type="xsd:string">three two</item>
> 
>                     <item xsi:type="xsd:string">three three</item>
> 
>                 </item>
> 
>             </my2d>
> 
>         </ns1:echo2dArray>
> 
>     </soapenv:Body>
> 
> </soapenv:Envelope>
> 
> 
> I think this is correct per the WSDL, but .NET says:
> 
>       <faultcode>soap:Client</faultcode>
> 
>       <faultstring>Server was unable to read request. --&gt; 
> There is an error in XML document (1, 638). --&gt; Object 
> cannot be stored in an array of this type.</faultstring>
> 
> 
> Thoughts?
> 
> --
> 
> Tom Jordahl
> 
> Macromedia Server Development
> 
>