Same problem posted on axis-user a while ago -- my solution
(workaround?) was to modify the Axis WSDL (attached).

Why this WSDL works and not the one generated by java2wsdl,
I leave to the experts to analyze... The bottom line of the
typedef is the same (an array of anyType). It's either a bug
in .Net, or in the generated WSDL (or perhaps something in
between?)...

-- Oliver

Tom Jordahl wrote:
> 
> If I have a Java class that looks like this:
> public class ArrayEcho {
>     public Object[] echoArray (Object[] a)
>     {
>         return a;
>     }
> 
> }
> 
> The WSDL we generate looks like this:
>   <types>
>    <schema targetNamespace="http://schemas.xmlsoap.org/soap/encoding/";
>          xmlns="http://www.w3.org/2001/XMLSchema";>
>      <element name="Array" nillable="true" type="SOAP-ENC:Array"/>
>    </schema>
>   </types>
>   <wsdl:message name="echoArrayRequest">
>     <wsdl:part name="a" type="SOAP-ENC:Array"/>
>   </wsdl:message>
>   <wsdl:message name="echoArrayResponse">
>     <wsdl:part name="return" type="SOAP-ENC:Array"/>
>   </wsdl:message>
> 
> Is this valid WSDL?
> 
> .NET wsdl.exe reports:
> -------------------------------------
> Schema validation warning: Type 'http://schemas.xmlsoap.org/soap/encoding/:Array' is 
>not declared.
> 
> Warning: Schema could not be validated. Class generation may fail or may produce 
>incorrect results.
> 
> Error: Unable to import binding 'ArrayEchoSoapBinding' from namespace 
>'http://localhost:8080/ArrayEcho.jws'.
>   - Unable to import operation 'echoArray'.
>   - The datatype 'Array' is missing.
> --------------------------------------------
> 
> But our tool correctly generates the stub:
>    public java.lang.Object[] echoArray(java.lang.Object[] a)
> 
> Does anyone (Rich?) who understands the WSDL we generate for Arrays have any insight 
>on this?  Are generating (and parsing) incorrect WSDL or do we understand 
>SOAP-ENC:Array and .NET just doesn't?
> 
> --
> Tom Jordahl
> Macromedia Server Development
<?xml version="1.0" encoding="UTF-8"?>

      <wsdl:definitions targetNamespace="http://domain.forwardvue.com";
      xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/";
      xmlns:xsd="http://www.w3.org/2001/XMLSchema";
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
      xmlns:intf="http://domain.forwardvue.com";
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
      xmlns:impl="http://domain.forwardvue.com-impl";
      xmlns="http://schemas.xmlsoap.org/wsdl/";>

       <types>

<!--
Replaced this typedef (SOAP-ENC:Array) with "ArrayOf_xsd_anyType",
and the references to "SOAP-ENC:Array" with "intf:ArrayOf_xsd_anyType":
        <schema xmlns="http://www.w3.org/2001/XMLSchema";
      targetNamespace="http://schemas.xmlsoap.org/soap/encoding/";>
         <element name="Array" nillable="true" type="SOAP-ENC:Array"/>
        </schema>
-->

<schema xmlns="http://www.w3.org/2001/XMLSchema"; 
targetNamespace="http://domain.forwardvue.com";>
<complexType name="ArrayOf_xsd_anyType">
<complexContent>
<restriction base="SOAP-ENC:Array">
<attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:anyType[]"/>
</restriction>
</complexContent>
</complexType>
<element name="ArrayOf_xsd_anyType" nillable="true" type="intf:ArrayOf_xsd_anyType"/>
</schema>

       </types>

       

         <wsdl:message name="setFooRequest">

       

            <wsdl:part name="arrayList" type="intf:ArrayOf_xsd_anyType"/>

       

         </wsdl:message>

       

         <wsdl:message name="getFooRequest">

       

         </wsdl:message>

       

         <wsdl:message name="setFooResponse">

       

         </wsdl:message>

       

         <wsdl:message name="getFooResponse">

       

            <wsdl:part name="return" type="intf:ArrayOf_xsd_anyType"/>

       

         </wsdl:message>

       

         <wsdl:message name="TestResponse">

       

         </wsdl:message>

       

         <wsdl:message name="TestRequest">

            <wsdl:part name="arrayList" type="intf:ArrayOf_xsd_anyType"/>
       

         </wsdl:message>

       

         <wsdl:portType name="Test">

       

            <wsdl:operation name="Test">

       

               <wsdl:input message="intf:TestRequest"/>

       

               <wsdl:output message="intf:TestResponse"/>

       

            </wsdl:operation>

       

            <wsdl:operation name="setFoo" parameterOrder="arrayList">

       

               <wsdl:input message="intf:setFooRequest"/>

       

               <wsdl:output message="intf:setFooResponse"/>

       

            </wsdl:operation>

       

            <wsdl:operation name="getFoo">

       

               <wsdl:input message="intf:getFooRequest"/>

       

               <wsdl:output message="intf:getFooResponse"/>

       

            </wsdl:operation>

       

         </wsdl:portType>

       

         <wsdl:binding name="ContractVueSoapBinding" type="intf:Test">

       

            <wsdlsoap:binding style="rpc"
      transport="http://schemas.xmlsoap.org/soap/http"/>

       

            <wsdl:operation name="Test">

       

               <wsdlsoap:operation soapAction=""/>

       

               <wsdl:input>

       

                  <wsdlsoap:body use="encoded"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
      namespace="http://domain.forwardvue.com"/>

       

               </wsdl:input>

       

               <wsdl:output>

       

                  <wsdlsoap:body use="encoded"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
      namespace="http://domain.forwardvue.com"/>

       

               </wsdl:output>

       

            </wsdl:operation>

       

            <wsdl:operation name="setFoo">

       

               <wsdlsoap:operation soapAction=""/>

       

               <wsdl:input>

       

                  <wsdlsoap:body use="encoded"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
      namespace="http://domain.forwardvue.com"/>

       

               </wsdl:input>

       

               <wsdl:output>

       

                  <wsdlsoap:body use="encoded"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
      namespace="http://domain.forwardvue.com"/>

       

               </wsdl:output>

       

            </wsdl:operation>

       

            <wsdl:operation name="getFoo">

       

               <wsdlsoap:operation soapAction=""/>

       

               <wsdl:input>

       

                  <wsdlsoap:body use="encoded"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
      namespace="http://domain.forwardvue.com"/>

       

               </wsdl:input>

       

               <wsdl:output>

       

                  <wsdlsoap:body use="encoded"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
      namespace="http://domain.forwardvue.com"/>

       

               </wsdl:output>

       

            </wsdl:operation>

       

         </wsdl:binding>

       

         <wsdl:service name="TestService">

       

            <wsdl:port name="ContractVue"
      binding="intf:ContractVueSoapBinding">

       

               <wsdlsoap:address
      location="http://localhost:8080/axis/services/ContractVue"/>

       

            </wsdl:port>

       

         </wsdl:service>

       

      </wsdl:definitions>
      

Reply via email to