We're using Axis 1.1 for our JAX-RPC client to a set of webservices.  We're
getting back 2D arrays fine from the service, but sending a 2D array is having
problems over on the web service side.

The WSDL only says that the message part that is the 2D array is xsd:anyType --
and they're not going to change it.  

Here is an example of how our client is serializing the 2D array going out from
Axis -

   <avarLineItem 
                xsi:type="soapenc:Array" 
                soapenc:arrayType="xsd:anyType[][2]" 
                xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";>
   <item xsi:type="soapenc:Array" soapenc:arrayType="xsd:anyType[3]">
     <item xsi:type="xsd:string">1</item>
     <item xsi:type="xsd:string">2</item>
     <item xsi:type="xsd:string">3</item>
   </item>
   <item xsi:type="soapenc:Array" soapenc:arrayType="xsd:anyType[3]">
     <item xsi:type="xsd:string">4</item>
     <item xsi:type="xsd:string">5</item>
     <item xsi:type="xsd:string">6</item>
    </item>
   </avarLineItem>


But the webservice is looking for something like this  -


    <avarLineItem 
                xsi:type="soapenc:Array" 
                soapenc:arrayType="xsd:anyType[2][3]" 
                xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";>
     <item xsi:type="xsd:string">1</item>
     <item xsi:type="xsd:string">2</item>
     <item xsi:type="xsd:string">3</item>
     <item xsi:type="xsd:string">4</item>
     <item xsi:type="xsd:string">5</item>
     <item xsi:type="xsd:string">6</item>
   </avarLineItem>

I have tried creating it in Java as Object[][], Object[] with ArrayLists inside
it, but can't get the object such that Axis serializes it as in example two.  I
understand that because 2D arrays in Java can be ragged, this may not be the
natural way they get represented with Axis' serialization.  But can anyone
provide advice of how to do get it serialized as in example 2?  Do I have to
write a custom serializer to do this?

Thanks for any help,
- Mark


Reply via email to