You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Ravi Kumar <rk...@borland.com> on 2001/10/03 18:01:53 UTC

WSDL Emitter TypeFactory: ComplexType handling ignores ComplexContent

The attached InteropTest.wsdl when run through the emitter fails to
output the Array classes. For instance, there is no ArrayOfString class
( but there is an ArrayOfStringHolder class).
The problem appears to be:

Given a WSDL type section with the following:

<complexType name="ArrayOfstring">
  <complexContent>
    <restriction base="SOAP-ENC:Array">
      <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/>
    </restriction>
  </complexContent>
</complexType>

TypeFactory.getComplexElementTypesAndNames(.) returns null

....

            for (int j = 0; j < children.getLength() && groupNode ==
null; j++) {
                QName groupKind = Utils.getNodeQName(children.item(j));
                if (groupKind != null &&
                    (groupKind.getLocalPart().equals("sequence") ||
                     groupKind.getLocalPart().equals("all")) &&
                    Utils.isSchemaNS(groupKind.getNamespaceURI()))
                    groupNode = children.item(j);
            }
....

Shouldn't groupKind check for complexContent as well?

Rgds
Ravi
JBuilder R&D


Re: WSDL Emitter TypeFactory: ComplexType handling ignores ComplexContent

Posted by Ravi Kumar <rk...@borland.com>.
Index: TypeFactory.java
===================================================================
RCS file: /home/cvspublic/xml-axis/java/src/org/apache/axis/wsdl/TypeFactory.java,v
retrieving revision 1.1
diff -r1.1 TypeFactory.java
160a161
>                      groupKind.getLocalPart().equals("complexContent") ||
293c294
<             if (nodeKind.getLocalPart().equals("simpleType") &&
---
>             else if (nodeKind.getLocalPart().equals("simpleType") &&


Ravi Kumar wrote:

> The attached InteropTest.wsdl when run through the emitter fails to
> output the Array classes. For instance, there is no ArrayOfString class
> ( but there is an ArrayOfStringHolder class).
> The problem appears to be:
>
> Given a WSDL type section with the following:
>
> <complexType name="ArrayOfstring">
>   <complexContent>
>     <restriction base="SOAP-ENC:Array">
>       <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/>
>     </restriction>
>   </complexContent>
> </complexType>
>
> TypeFactory.getComplexElementTypesAndNames(.) returns null
>
> ....
>
>             for (int j = 0; j < children.getLength() && groupNode ==
> null; j++) {
>                 QName groupKind = Utils.getNodeQName(children.item(j));
>                 if (groupKind != null &&
>                     (groupKind.getLocalPart().equals("sequence") ||
>                      groupKind.getLocalPart().equals("all")) &&
>                     Utils.isSchemaNS(groupKind.getNamespaceURI()))
>                     groupNode = children.item(j);
>             }
> ....
>
> Shouldn't groupKind check for complexContent as well?
>
> Rgds
> Ravi
> JBuilder R&D
>
>   ------------------------------------------------------------------------
> <?xml version="1.0"?>
> <definitions name="InteropTest" targetNamespace="http://soapinterop.org" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
>
>         <types>
>                 <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd">
>                         <complexType name="ArrayOfstring">
>                                 <complexContent>
>                                         <restriction base="SOAP-ENC:Array">
>                                                 <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/>
>                                         </restriction>
>                                 </complexContent>
>                         </complexType>
>                         <complexType name="ArrayOfint">
>                                 <complexContent>
>                                         <restriction base="SOAP-ENC:Array">
>                                                 <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
>                                         </restriction>
>                                 </complexContent>
>                         </complexType>
>                         <complexType name="ArrayOffloat">
>                                 <complexContent>
>                                         <restriction base="SOAP-ENC:Array">
>                                                 <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/>
>                                         </restriction>
>                                 </complexContent>
>                         </complexType>
>                         <complexType name="ArrayOfSOAPStruct">
>                                 <complexContent>
>                                         <restriction base="SOAP-ENC:Array">
>                                                 <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/>
>                                         </restriction>
>                                 </complexContent>
>                         </complexType>
>                         <complexType name="SOAPStruct">
>                                 <all>
>                                         <element name="varString" type="string"/>
>                                         <element name="varInt" type="int"/>
>                                         <element name="varFloat" type="float"/>
>                                 </all>
>                         </complexType>
>                 </schema>
>         </types>
>
>         <message name="echoStringRequest">
>                 <part name="inputString" type="xsd:string"/>
>         </message>
>         <message name="echoStringResponse">
>                 <part name="return" type="xsd:string"/>
>         </message>
>         <message name="echoStringArrayRequest">
>                 <part name="inputStringArray" type="s:ArrayOfstring"/>
>         </message>
>         <message name="echoStringArrayResponse">
>                 <part name="return" type="s:ArrayOfstring"/>
>         </message>
>         <message name="echoIntegerRequest">
>                 <part name="inputInteger" type="xsd:int"/>
>         </message>
>         <message name="echoIntegerResponse">
>                 <part name="return" type="xsd:int"/>
>         </message>
>         <message name="echoIntegerArrayRequest">
>                 <part name="inputIntegerArray" type="s:ArrayOfint"/>
>         </message>
>         <message name="echoIntegerArrayResponse">
>                 <part name="return" type="s:ArrayOfint"/>
>         </message>
>         <message name="echoFloatRequest">
>                 <part name="inputFloat" type="xsd:float"/>
>         </message>
>         <message name="echoFloatResponse">
>                 <part name="return" type="xsd:float"/>
>         </message>
>         <message name="echoFloatArrayRequest">
>                 <part name="inputFloatArray" type="s:ArrayOffloat"/>
>         </message>
>         <message name="echoFloatArrayResponse">
>                 <part name="return" type="s:ArrayOffloat"/>
>         </message>
>         <message name="echoStructRequest">
>                 <part name="inputStruct" type="s:SOAPStruct"/>
>         </message>
>         <message name="echoStructResponse">
>                 <part name="return" type="s:SOAPStruct"/>
>         </message>
>         <message name="echoStructArrayRequest">
>                 <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/>
>         </message>
>         <message name="echoStructArrayResponse">
>                 <part name="return" type="s:ArrayOfSOAPStruct"/>
>         </message>
>         <message name="echoVoidRequest"/>
>         <message name="echoVoidResponse"/>
>         <message name="echoBase64Request">
>                 <part name="inputBase64" type="xsd:base64Binary"/>
>         </message>
>         <message name="echoBase64Response">
>                 <part name="return" type="xsd:base64Binary"/>
>         </message>
>         <message name="echoDateRequest">
>                 <part name="inputDate" type="xsd:dateTime"/>
>         </message>
>         <message name="echoDateResponse">
>                 <part name="return" type="xsd:dateTime"/>
>         </message>
>         <message name="echoHexBinaryRequest">
>                 <part name="inputHexBinary" type="xsd:hexBinary"/>
>         </message>
>         <message name="echoHexBinaryResponse">
>                 <part name="return" type="xsd:hexBinary"/>
>         </message>
>         <message name="echoDecimalRequest">
>                 <part name="inputDecimal" type="xsd:decimal"/>
>         </message>
>         <message name="echoDecimalResponse">
>                 <part name="return" type="xsd:decimal"/>
>         </message>
>         <message name="echoBooleanRequest">
>                 <part name="inputBoolean" type="xsd:boolean"/>
>         </message>
>         <message name="echoBooleanResponse">
>                 <part name="return" type="xsd:boolean"/>
>         </message>
>
>         <portType name="InteropTestPortType">
>                 <operation name="echoString" parameterOrder="inputString">
>                         <input message="tns:echoStringRequest" name="echoString"/>
>                         <output message="tns:echoStringResponse" name="echoStringResponse"/>
>                 </operation>
>                 <operation name="echoStringArray" parameterOrder="inputStringArray">
>                         <input message="tns:echoStringArrayRequest" name="echoStringArray"/>
>                         <output message="tns:echoStringArrayResponse" name="echoStringArrayResponse"/>
>                 </operation>
>                 <operation name="echoInteger" parameterOrder="inputInteger">
>                         <input message="tns:echoIntegerRequest" name="echoInteger"/>
>                         <output message="tns:echoIntegerResponse" name="echoIntegerResponse"/>
>                 </operation>
>                 <operation name="echoIntegerArray" parameterOrder="inputIntegerArray">
>                         <input message="tns:echoIntegerArrayRequest" name="echoIntegerArray"/>
>                         <output message="tns:echoIntegerArrayResponse" name="echoIntegerArrayResponse"/>
>                 </operation>
>                 <operation name="echoFloat" parameterOrder="inputFloat">
>                         <input message="tns:echoFloatRequest" name="echoFloat"/>
>                         <output message="tns:echoFloatResponse" name="echoFloatResponse"/>
>                 </operation>
>                 <operation name="echoFloatArray" parameterOrder="inputFloatArray">
>                         <input message="tns:echoFloatArrayRequest" name="echoFloatArray"/>
>                         <output message="tns:echoFloatArrayResponse" name="echoFloatArrayResponse"/>
>                 </operation>
>                 <operation name="echoStruct" parameterOrder="inputStruct">
>                         <input message="tns:echoStructRequest" name="echoStruct"/>
>                         <output message="tns:echoStructResponse" name="echoStructResponse"/>
>                 </operation>
>                 <operation name="echoStructArray" parameterOrder="inputStructArray">
>                         <input message="tns:echoStructArrayRequest" name="echoStructArray"/>
>                         <output message="tns:echoStructArrayResponse" name="echoStructArrayResponse"/>
>                 </operation>
>                 <operation name="echoVoid">
>                         <input message="tns:echoVoidRequest" name="echoVoid"/>
>                         <output message="tns:echoVoidResponse" name="echoVoidResponse"/>
>                 </operation>
>                 <operation name="echoBase64" parameterOrder="inputBase64">
>                         <input message="tns:echoBase64Request" name="echoBase64"/>
>                         <output message="tns:echoBase64Response" name="echoBase64Response"/>
>                 </operation>
>                 <operation name="echoDate" parameterOrder="inputDate">
>                         <input message="tns:echoDateRequest" name="echoDate"/>
>                         <output message="tns:echoDateResponse" name="echoDateResponse"/>
>                 </operation>
> <!--            <operation name="echoHexBinary" parameterOrder="inputHexBinary">
>                         <input message="tns:echoHexBinaryRequest" name="echoHexBinary"/>
>                         <output message="tns:echoHexBinaryResponse" name="echoHexBinaryResponse"/>
>                 </operation>
> -->
>                 <operation name="echoDecimal" parameterOrder="inputDecimal">
>                         <input message="tns:echoDecimalRequest" name="echoDecimal"/>
>                         <output message="tns:echoDecimalResponse" name="echoDecimalResponse"/>
>                 </operation>
>                 <operation name="echoBoolean" parameterOrder="inputBoolean">
>                         <input message="tns:echoBooleanRequest" name="echoBoolean"/>
>                         <output message="tns:echoBooleanResponse" name="echoBooleanResponse"/>
>                 </operation>
>         </portType>
>
>         <binding name="InteropTestSoapBinding" type="tns:InteropTestPortType">
>                 <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
>                 <operation name="echoString">
>                         <soap:operation soapAction="http://soapinterop.org/"/>
>                         <input>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </input>
>                         <output>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </output>
>                 </operation>
>                 <operation name="echoStringArray">
>                         <soap:operation soapAction="http://soapinterop.org/"/>
>                         <input>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </input>
>                         <output>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </output>
>                 </operation>
>                 <operation name="echoInteger">
>                         <soap:operation soapAction="http://soapinterop.org/"/>
>                         <input>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </input>
>                         <output>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </output>
>                 </operation>
>                 <operation name="echoIntegerArray">
>                         <soap:operation soapAction="http://soapinterop.org/"/>
>                         <input>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </input>
>                         <output>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </output>
>                 </operation>
>                 <operation name="echoFloat">
>                         <soap:operation soapAction="http://soapinterop.org/"/>
>                         <input>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </input>
>                         <output>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </output>
>                 </operation>
>                 <operation name="echoFloatArray">
>                         <soap:operation soapAction="http://soapinterop.org/"/>
>                         <input>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </input>
>                         <output>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </output>
>                 </operation>
>                 <operation name="echoStruct">
>                         <soap:operation soapAction="http://soapinterop.org/"/>
>                         <input>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </input>
>                         <output>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </output>
>                 </operation>
>                 <operation name="echoStructArray">
>                         <soap:operation soapAction="http://soapinterop.org/"/>
>                         <input>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </input>
>                         <output>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </output>
>                 </operation>
>                 <operation name="echoVoid">
>                         <soap:operation soapAction="http://soapinterop.org/"/>
>                         <input>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </input>
>                         <output>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </output>
>                 </operation>
>                 <operation name="echoBase64">
>                         <soap:operation soapAction="http://soapinterop.org/"/>
>                         <input>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </input>
>                         <output>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </output>
>                 </operation>
>                 <operation name="echoDate">
>                         <soap:operation soapAction="http://soapinterop.org/"/>
>                         <input>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </input>
>                         <output>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </output>
>                 </operation>
> <!--            <operation name="echoHexBinary">
>                         <soap:operation soapAction="http://soapinterop.org/"/>
>                         <input>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </input>
>                         <output>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </output>
>                 </operation>
> -->
>                 <operation name="echoDecimal">
>                         <soap:operation soapAction="http://soapinterop.org/"/>
>                         <input>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </input>
>                         <output>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </output>
>                 </operation>
>                 <operation name="echoBoolean">
>                         <soap:operation soapAction="http://soapinterop.org/"/>
>                         <input>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </input>
>                         <output>
>                                 <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>                         </output>
>                 </operation>
>         </binding>
>
> </definitions>