axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cun Yong Tan" <cyong...@hotmail.com>
Subject Re: HELP: Multi-Dimensional Array vs. Array of Array Encoding!!
Date Wed, 11 Sep 2002 20:56:55 GMT

I ran into the same problem using .NET as a client.
The problem is in Axis's ArraySerializer.java code.
There is a hard-coded boolean in that file (beta3 code)
named  "enable2Dim" :


        // 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

The code attempts to send an array of arrays as a 2 dimensional array. The 
problem is that .NET cannot handle multi-dimensional arrays and apparently, 
neither can Apache SOAP.

Axis dev, shouldn't that boolean not be hard-coded or be
made configurable ?



>From: "Matias Klein" <matias@ethidium.com>
>Reply-To: axis-user@xml.apache.org
>To: <axis-user@xml.apache.org>
>Subject: HELP: Multi-Dimensional Array vs. Array of Array Encoding!!
>Date: Wed, 11 Sep 2002 15:16:26 -0400
>
>Hi,
>
>I have a SOAP client that was working fine with Apache SOAP 2.2, but
>when I upgraded to Axis, it broke.
>
>The problem is that I'm returning an array of arrays but Axis encodes it
>as a multi-dimensional array.
>
>Any help on how to get Axis to return the values as an array of arrays
>is greatly appreciated.
>
>Here is an example:
>
>========================================================================
>====
>Apache SOAP 2.2 Response (Array of Array)
>========================================================================
>====
>
>//...
>
><return xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/"
>xsi:type="ns2:Array" ns2:arrayType="ns2:Array[1]">
><item xsi:type="ns2:Array" ns2:arrayType="xsd:string[2]">
><item xsi:type="xsd:string">Test1</item>
><item xsi:type="xsd:string">Test2</item>
></item>
></return>
>
>...//
>
>
>========================================================================
>====
>Apache Axis Response (Muli-Dimensional Array)
>========================================================================
>====
>
>//...
>
><getTest xsi:type="soapenc:Array"
>soapenc:arrayType="xsd:string[1,2]"
>xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
><item xsi:type="xsd:string">Test1</item>
><item xsi:type="xsd:string">Test2</item>
></getAppointmentsReturn>
></ns1:getTest>
>
>...//
>
>========================================================================
>====
>Java Server-Side Code
>========================================================================
>====
>
>//...
>
>String[][] results;
>results = new String[1][2];
>			results[0][1] = "Test1";
>			results[0][2] = "Test2";
>Return results;
>
>...//
>
>
>
>Thanks,
>
>Matias Klein




Cun Yong Tan
cyongtan@hotmail.com


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


Mime
View raw message