axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Russell Butek" <bu...@us.ibm.com>
Subject Re: WSDL2Java optional arrays
Date Tue, 05 Feb 2002 19:53:40 GMT
I guess I need more info.  I tried a couple variations of the use of
optionalStringArrayTest and they compiled.  Could I see the full WSDL?
What version are you running?

Russell Butek
butek@us.ibm.com


Thomas Sandholm <sandholm@mcs.anl.gov> on 02/05/2002 01:11:58 PM

Please respond to axis-dev@xml.apache.org

To:   axis-dev@xml.apache.org
cc:
Subject:  WSDL2Java optional arrays



Hi,

I have some problems with optional arrays and WSDL2Java.

This is in my WSDL def:

   <complexType name="ArrayOfString">
     <complexContent>
       <restriction base="soap-enc:Array">
         <attribute ref="soap-enc:arrayType" wsdl:arrayType="string[]"/>
       </restriction>
     </complexContent>
   </complexType>

   ...
  <element name="optionalStringArrayTest" type="base-types:ArrayOfString"
minOccurs="0" maxOccurs="1"/>
   ...

Now the stub code will give me the following error:

CreationType.java:115: ']' expected
             java.lang.String[][] a = new java.lang.String[][i+1];


Below is a bigger snippet from the failing stub code:

public void setOptionalStringArrayTest(int i, java.lang.String[] value) {
         if (optionalStringArrayTest == null ||
             optionalStringArrayTest.length <= i) {
             java.lang.String[][] a = new java.lang.String[][i+1];
             if (optionalStringArrayTest != null) {
                 for(int j=0; j<optionalStringArrayTest.length; j++)
                     a[j] = optionalStringArrayTest[j];
             }
             optionalStringArrayTest = a;
         }
         optionalStringArrayTest[i] = value;
     }

I'd appreciate if anyone could shed some light on this.

Thanks,
    Thomas


Thomas Sandholm <sandholm@mcs.anl.gov>
The Globus Project(tm) <http://www.globus.org>
Distributed Systems Laboratory
Mathematics and Computer Science Division
Argonne National Laboratory




Mime
View raw message