axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Neward <T...@matmail.ucdavis.edu>
Subject RE: .NET Interop problem with jagged arrays
Date Tue, 23 Jul 2002 19:59:17 GMT
Multidimensional arrays are not CLS-compliant, perhaps, which is why the
poster was getting the error back from a WebMethod. However, it is certainly
possible to use them within ASP.NET so long as the CodeDOM in question (such
as C#) supports it.

This is, however, getting wildly offtopic; the larger question is whether
WSDL/XSD tools can handle it. :-)

Ted Neward
Architect, UCDavis Account & Financial Services
http://www.javageeks.com
http://www.clrgeeks.com

-----Original Message-----
From: Cun Yong Tan [mailto:cyongtan@hotmail.com]
Sent: Tuesday, July 23, 2002 12:50
To: axis-user@xml.apache.org
Subject: RE: .NET Interop problem with jagged arrays



Yes, I should have been clearer.
.NET does handle both multi-dim and jagged arrays.
It's ASP.NET that doesn't handle multi-dimensional arrays.

I haven't tried it myself but have ran into several different postings on
microsoft.public.dotnet.framework.aspnet.webservices
where this has been stated quite clearly.

For example:

http://groups.google.com/groups?q=jagged+arrays+group:microsoft.public.dotne
t.framework.aspnet.webservices&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=uF%2423CZ%24
BHA.2040%40tkmsftngp05&rnum=3



>From: Ted Neward <TedN@matmail.ucdavis.edu>
>Reply-To: axis-user@xml.apache.org
>To: "'axis-user@xml.apache.org'" <axis-user@xml.apache.org>
>Subject: RE: .NET Interop problem with jagged arrays Date: Tue, 23 Jul 2002

>12:25:41 -0700
>
> > This code attempts to send an array of arrays as a 2 dimensional array.
>The
> > problem is that .NET cannot handle multi-dimensional arrays (but can
>handle
> > jagged arrays).  Can this boolean not be hard-coded but instead be
> > configurable so it may have a chance of interoperating with .NET ?
> >
>.NET most certainly can handle multidimensional arrays--it supports both.
>
>In general, you're probably better off building the complex type "by hand":
>
><complexType name="ArrayOfStringT">
>   <sequence minOccurs="0" maxOccurs="unbounded">
>     <element name="item" type="xsd:string" />
>   <sequence>
></complexType>
><complexType name="ArrayOfArrayOfStringT">
>   <sequence minOccurs="0" maxOccurs="unbounded">
>     <element name="item" type="tns:ArrayOfStringT" />
>   <sequence>
></complexType>
><element name="aoaos" type="tns:ArrayOfArrayOfStringT" />
>
>For best results with respect to interoperability, write your WSDL first.
>
>Ted Neward
>Architect, UCDavis Account & Financial Services
>http://www.javageeks.com
>http://www.clrgeeks.com
>
>-----Original Message-----
>From: Cun Yong Tan [mailto:cyongtan@hotmail.com]
>Sent: Tuesday, July 23, 2002 11:03
>To: axis-user@xml.apache.org
>Subject: .NET Interop problem with jagged arrays
>
>
>
>There seems to be an interop problem with .NET with jagged arrays
>(array of arrays).  I have a method exposed by Axis like so:
>
>     public String[][] getArrayOfStringArray(String[][] arg)    {
>         return arg;
>     }
>
>Here is the relevant part of the WSDL that was generated by Axis for the
>String[][] type:
>
>...
>   <complexType name="ArrayOfArrayOf_xsd_string">
>    <complexContent>
>     <restriction base="soapenc:Array">
>      <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[][]"/>
>     </restriction>
>    </complexContent>
>   </complexType>
>   <element name="ArrayOfArrayOf_xsd_string" nillable="true"
>type="intf:ArrayOfArrayOf_xsd_string"/>
>...
>
>
>When I use .NET's WSDL.exe to generate the proxy, it generates a different
>type than what is expected.  (It generates String[][] as string[] instead 
>of
>
>string[][]).
>
>         public string[] getArrayOfStringArray(string[] arg) {
>             object[] results = this.Invoke("getArrayOfStringArray",
>                       new object[] { arg});
>             return ((string[])(results[0]));
>         }
>
>Has anyone run into this problem also ?  Anyone knows of a workaround
>(wsdl written differently etc)
>
>
>There may be potentially be another problem. This one is in Axis's
>ArraySerializer.java code. In ArraySerializer.java,
>there is a hard-coded boolean (this is beta2 code) named  enbale2Dim:
>
>
>         // Discover whether array can be serialized directly as a
>two-dimensional
>         // array (i.e. arrayType=int[2,3]) versus an array of arrays.
>         ...
>          boolean enable2Dim = true;  // Enabled 2-Dim processing
>
>This code attempts to send an array of arrays as a 2 dimensional array. The
>problem is that .NET cannot handle multi-dimensional arrays (but can handle
>jagged arrays).  Can this boolean not be hard-coded but instead be
>configurable so it may have a chance of interoperating with .NET ?
>
>
>
>
>
>_________________________________________________________________
>Send and receive Hotmail on your mobile device: http://mobile.msn.com




Cun Yong Tan
cyongtan@hotmail.com


_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

Mime
View raw message