axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cun Yong Tan" <cyong...@hotmail.com>
Subject .NET Interop issue: Making enabling 2 dim array support configurable
Date Wed, 24 Jul 2002 15:24:49 GMT

There is a hard-coded boolean in ArraySerializer.java that tries to
send a 2 dim array instead of an array of arrays if it is possible.
Here is the code snippet:


        // Discover whether array can be serialized directly as a 
two-dimensional
        // array (i.e. arrayType=int[2,3]) versus an array of arrays.
        // Benefits:
        //   - Less text passed on the wire.
        //   - Easier to read wire format
        //   - Tests the deserialization of multi-dimensional arrays.
        // Drawbacks:
        //   - Is not safe!  It is possible that the arrays are multiply
        //     referenced.  Transforming into a 2-dim array will cause the
        //     multi-referenced information to be lost.  Plus there is no
        //     way to determine whether the arrays are multi-referenced.
        //     Thus the code is currently disabled (see enable2Dim below).
        //
        // Currently the support is ENABLED because it is necessary for
        // interoperability (echo2DStringArray).  It is 'safe' for now
        // because Axis treats arrays as non multi-ref (see the note
        // in SerializationContextImpl.isPrimitive(...) )
        // More complicated processing is necessary for 3-dim arrays, etc.
        //
        int dim2Len = -1;
        boolean enable2Dim = true;  // Enabled 2-Dim processing
        if (enable2Dim && !dims.equals("")) {
            <code omitted here>



This causes a problem with .NET interop because it doesn't handle 
multi-dimensional array.  The is the error from .NET client:

*** Exception ***
System.InvalidOperationException: There is an error in XML document (5, 5). 
---> System.ArgumentException: SOAP-ENC:arrayType with multidimensional 
array found at <getArrayOfStringArrayReturn xmlns=''>. Only 
single-dimensional arrays are supported. Consider using an array of arrays 
instead.

Can you make that "enable2Dim" variable configurable somehow (perhaps as a 
service option ?) to avoid this interop issue.

Thanks.



_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


Mime
View raw message