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
[EMAIL PROTECTED]


Thomas Sandholm <[EMAIL PROTECTED]> on 02/05/2002 01:11:58 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
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 <[EMAIL PROTECTED]>
The Globus Project(tm) <http://www.globus.org>
Distributed Systems Laboratory
Mathematics and Computer Science Division
Argonne National Laboratory



Reply via email to