You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by Ryan Lambert <rl...@zantaz.com> on 2002/07/26 20:54:24 UTC

SOAP - Multi-dimentional Arrays ?

Hello !

I wanted to find out if SOAP supports multi-dimentional arrays ?

It seems that a single dimentional array works just fine, but what about 2
dimentional arrays ??

What if I want to send in ( from client to the server ) a String [][] array
???

If I specifiy the class type in the parameter as String[][].class I get an
error ???


For the single dimentional example see below :

On the client side I have the following :

  public void TestStringArray() {
    strMethod = "testStringArray";
    String [] strInput = null;
    String [] strArray = null;
    strInput = new String [] {"Entry 0", "Entry 1", "Entry 2", "Entry 3",
"Entry 4"};
    vParm = new Vector();
    vParm.clear();
    vParm.addElement (new Parameter("strSessionKey", String[].class,
strInput, null));
    try {
      oReturn = soapCall(strURI, strMethod, vParm);
      strArray = (String [])oReturn;
      System.out.println("Test String Array : " + oReturn);
      for(int Z=0; Z<strArray.length; Z++) {
        System.out.println("Test String Array : " + strArray[Z].toString());
      }
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }

On the server I have the following :

  public String [] testStringArray(String [] strArray) {
    String [] strReturn = null;
    int iLength = 0;

    iLength = strArray.length;

    strReturn = new String [iLength];

    for (int i=0; i<iLength; i++) {
      strReturn[i] = "SOAPServer : " + strArray[i];
    }

    return strReturn;
  }




This e-mail has been captured and archived by the ZANTAZ Digital Safe(tm)
service.  For more information, visit us at www.zantaz.com. 
IMPORTANT: This electronic mail message is intended only for the use of the
individual or entity to which it is addressed and may contain information
that is privileged, confidential or exempt from disclosure under applicable
law.  If the reader of this message is not the intended recipient, or the
employee or agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If you have received
this communication in error, please notify the sender immediately by
telephone or directly reply to the original message(s) sent.  Thank you.