Title: .NET multi dimensional array

I have a Java web service published to Axis that returns a 2 dimensional String array.  It take no parameters:
public String[][] getTwo()
{
        String[][] multiArray = new String[2][3];
        multiArray[0][0] = "One1";
        multiArray[0][1] = "One2";
        multiArray[0][2] = "One3";

        multiArray[1][0] = "Two1";
        multiArray[1][1] = "Two2";
        multiArray[1][2] = "Two3";

        return multiArray;

}

I generate the WSDL and it looks great.
I generate Java clients with WSDL2Java.
Execute this code and it works great.

I then go into .NET
If I call a method that returns a one dimensional String array, then .NET works good.

But, the return method in .NET of getTwo() only returns a 'single' dimension array.  I cannot cast it to anything else.

If I leave it at a single dimension, and run it, .NET give a message saying it does not suppor it.
Is this true?
It is saying I should use an array of arrays instead.

----------------.NET error---------------------------------------
Error consulting: System.InvalidOperationException: There is an error in XML doc
ument (5, 5). ---> System.ArgumentException: SOAP-ENC:arrayType with multidimens
ional array found at <getTwoReturn xmlns=''>. Only single-dimensional arrays are
 supported. Consider using an array of arrays instead.
Parameter name: value
   at System.Xml.Serialization.XmlSerializationReader.ParseArrayType(String valu
e)
   at System.Xml.Serialization.XmlSerializationReader.ReadArray()
   at System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(Str
ing name, String ns, Boolean elementCanBeType, String& fixupReference)

----------------------------The WSDL looks like this:-----------------------
- <wsdl:types>
- <schema targetNamespace="http://localhost:8080/WSB/soap/TestRama" xmlns="http://www.w3.org/2001/XMLSchema">
  <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
- <complexType name="ArrayOf_xsd_string">
- <complexContent>
- <restriction base="soapenc:Array">
  <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" />
  </restriction>
  </complexContent>
  </complexType>
  <element name="ArrayOf_xsd_string" nillable="true" type="impl:ArrayOf_xsd_string" />
- <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="impl:ArrayOfArrayOf_xsd_string" />
  </schema>
  </wsdl:types>


Reply via email to