axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Sandholm <sandh...@mcs.anl.gov>
Subject Re: WSDL2Java optional arrays
Date Tue, 05 Feb 2002 20:32:45 GMT
I checked out Axis from CVS a couple of days ago, her's the full WSDL:

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="OptionalArrayDefinition"
   targetNamespace="http://test.globus.org/optionalarray"
   xmlns:tns="http://test.globus.org/optionalarray"
   xmlns:types="http://test.globus.org/types"
   xmlns="http://schemas.xmlsoap.org/wsdl/"
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">

<types>
<schema targetNamespace="http://test.globus.org/types"
         xmlns:tns="http://test.globus.org/types"
         xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <xsd:complexType name="ArrayOfString">
      <xsd:complexContent>
        <xsd:restriction base="soap-enc:Array">
          <xsd:attribute ref="soap-enc:arrayType" arrayType="xsd:string[]"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="OptionalStringArrayType">
     <xsd:sequence>
       <xsd:element name="optionalStringArray" type="tns:ArrayOfString" 
minOccurs="0" maxOccurs="1"/>
     </xsd:sequence>
   </xsd:complexType>
</schema>
</types>

<message name="sendOptionalArrayRequest">
   <part name="optionalArray" type="types:OptionalStringArrayType"/>
</message>
<message name="sendOptionalArrayResponse"/>

<portType name="OptionalArrayPortType">
   <operation name="sendOptionalArray">
     <input message="tns:sendOptionalArrayRequest"/>
     <output message="tns:sendOptionalArrayResponse"/>
   </operation>
</portType>

<binding name="OptionalArraySOAPBinding" type="tns:OptionalArrayPortType">
   <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
   <operation name="sendOptionalArray">
     <soap:operation 
soapAction="http://test.globus.org/optional_array#sendOptionalArray"/>
     <input>
       <soap:body use="encoded" 
namespace="http://test.globus.org/optional_array"
                                encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
     </input>
     <output>
       <soap:body use="encoded" 
namespace="http://test.globus.org/optional_array"
                                encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
     </output>
   </operation>
</binding>

<service name="OptionalArrayService">
   <port binding="tns:OptionalArraySOAPBinding"
         name="RegistryPort">
     <soap:address location="http://localhost:8080/axis/services"/>
   </port>
</service>

</definitions>



At 01:53 PM 2/5/2002 -0600, Russell Butek wrote:
>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

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