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 Matias Klein <ma...@ethidium.com> on 2002/09/11 21:16:26 UTC

HELP: Multi-Dimensional Array vs. Array of Array Encoding!!

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