ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> Apache-Soap-Dev
Apache-Soap-Dev
SOAP - Multi-dimentional Arrays ?
by Ryan Lambert other posts by this author
Jul 26 2002 6:54PM messages near this date
Re: Help me! MS Soap & Apache soap Interop | cvs commit: xml-soap/java/src/org/apache/soap/util/xml DOMUtils.java
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.

--
To unsubscribe, e-mail:   <mailto:soap-dev-unsubscribe@[...].org> 
For additional commands, e-mail: <mailto:soap-dev-help@[...].org> 

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved