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 bu...@apache.org on 2002/08/05 23:50:06 UTC

DO NOT REPLY [Bug 11483] New: - Problem using Axis Web Services with .NET Client

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11483>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11483

Problem using Axis Web Services with .NET Client

           Summary: Problem using Axis Web Services with .NET Client
           Product: Axis
           Version: beta-3
          Platform: All
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Serialization/Deserialization
        AssignedTo: axis-dev@xml.apache.org
        ReportedBy: Saurabh.Mehta@sabre.com


I have developed a simple web service which echoes an array of strings. The web 
service works fine with a java client. But when I am using a .NET client 
application to generate the proxy class (using wsdl.exe tool in .NET), it 
generates the following warnings/errors:

Schema validation warning: Undefined 
complexType 'http://schemas.xmlsoap.org/soap/encoding/:Array' is used as a base 
for complex type restriction".
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 'DemoServiceSoapBinding' from 
namespace 'urn:SampleString'.
  - Unable to import operation 'getOperationDescs'.
  - The datatype 'Array' is missing.

I tried to change the SOAP specs to 1.1 and 1.2 but faced the same problem. I 
also changed the encoding of .NET to SOAP/RPC encoding. Is this a Bug or do I 
need to make any further changes to get this to work?

Another thing that I noticed is that if I copied the wsdl file (generated using 
the Java2WSDL command) from the server to the client, I could successfully 
create the proxy class in .NET. But if I used the WSDL file from the URL of the 
web service, I would get the errors mentioned above. Why are these two wsdl 
files different??

I have enclosed this wsdl file below. The interface used to generated the wsdl 
file is:

Interface
----------

public interface WebService extends java.rmi.Remote{
   public String[] echoStringArray(String[] strs);
}

The wsdl file generated by the Java2WSDL tool is:

WSDL (using Java2WSDL)
------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:SampleString" 
xmlns:impl="urn:SampleString-impl" xmlns:intf="urn:SampleString" 
xmlns:apachesoap="http://xml.apache.org/xml-soap" 
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns="http://schemas.xmlsoap.org/wsdl/">
 <wsdl:types>
  <schema xmlns="http://www.w3.org/2001/XMLSchema" 
targetNamespace="urn:SampleString">
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="ArrayOf_soapenc_string">
    <complexContent>
     <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType" wsdl:arrayType="soapenc:string[]"/>
     </restriction>
    </complexContent>
   </complexType>
   <element name="ArrayOf_soapenc_string" nillable="true" 
type="intf:ArrayOf_soapenc_string"/>
  </schema>
 </wsdl:types>
   <wsdl:message name="echoStringArrayResponse">
      <wsdl:part name="return" type="intf:ArrayOf_soapenc_string"/>
   </wsdl:message>
   <wsdl:message name="echoStringArrayRequest">
      <wsdl:part name="in0" type="intf:ArrayOf_soapenc_string"/>
   </wsdl:message>
   <wsdl:portType name="WebService">
     <wsdl:operation name="echoStringArray" parameterOrder="in0">
         <wsdl:input name="echoStringArrayRequest" 
message="intf:echoStringArrayRequest"/>
         <wsdl:output name="echoStringArrayResponse" 
message="intf:echoStringArrayResponse"/>
      </wsdl:operation>
   </wsdl:portType>
   <wsdl:binding name="DemoServiceSoapBinding" type="intf:WebService">
      <wsdlsoap:binding style="rpc" 
transport="http://schemas.xmlsoap.org/soap/http"/>
     <wsdl:operation name="echoStringArray">
         <wsdlsoap:operation soapAction=""/>
         <wsdl:input name="echoStringArrayRequest">
            <wsdlsoap:body use="encoded" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
namespace="urn:SampleString"/>
         </wsdl:input>
         <wsdl:output name="echoStringArrayResponse">
            <wsdlsoap:body use="encoded" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
namespace="urn:SampleString"/>
         </wsdl:output>
     </wsdl:operation>
   </wsdl:binding>
   <wsdl:service name="WebServiceService">
      <wsdl:port name="DemoService" binding="intf:DemoServiceSoapBinding">
         <wsdlsoap:address 
location="http://localhost:8080/axis/services/DemoService"/>
      </wsdl:port>
   </wsdl:service>
</wsdl:definitions>




The wsdl file seen the browser by the URL 
(http://localhost:8080/axis/services/DemoService?wsdl) is:



WSDL (seen by the browser)
----------------------------

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:SampleString" 
xmlns:impl="urn:SampleString-impl" xmlns:intf="urn:SampleString" 
xmlns:apachesoap="http://xml.apache.org/xml-soap" 
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns="http://schemas.xmlsoap.org/wsdl/"><wsdl:types><schema 
xmlns="http://www.w3.org/2001/XMLSchema" 
targetNamespace="urn:SampleString"><import 
namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType 
name="ArrayOf_soapenc_string"><complexContent><restriction 
base="soapenc:Array"><attribute ref="soapenc:arrayType" 
wsdl:arrayType="xsd:string
[]"/></restriction></complexContent></complexType><element 
name="ArrayOf_soapenc_string" nillable="true" 
type="intf:ArrayOf_soapenc_string"/></schema><schema 
xmlns="http://www.w3.org/2001/XMLSchema" 
targetNamespace="http://schemas.xmlsoap.org/soap/encoding/"><import 
namespace="http://schemas.xmlsoap.org/soap/encoding/"/><element name="Array" 
nillable="true" type="soapenc:Array"/></schema></wsdl:types>
  <wsdl:message name="getOperationDescsRequest">
  </wsdl:message>
  <wsdl:message name="getOperationDescByNameRequest">
    <wsdl:part name="methodName" type="xsd:string"/>
  </wsdl:message>
  <wsdl:message name="echoStringArrayResponse">
    <wsdl:part name="return" type="intf:ArrayOf_soapenc_string"/>
  </wsdl:message>
  <wsdl:message name="echoStringArrayRequest">
    <wsdl:part name="in0" type="intf:ArrayOf_soapenc_string"/>
  </wsdl:message>
  <wsdl:message name="getOperationDescsResponse">
    <wsdl:part name="return" type="soapenc:Array"/>
  </wsdl:message>
  <wsdl:message name="getOperationDescByNameResponse">
    <wsdl:part name="return" type="soapenc:Array"/>
  </wsdl:message>
  <wsdl:portType name="WebService">
    <wsdl:operation name="echoStringArray" parameterOrder="in0">
      <wsdl:input name="echoStringArrayRequest" 
message="intf:echoStringArrayRequest"/>
      <wsdl:output name="echoStringArrayResponse" 
message="intf:echoStringArrayResponse"/>
    </wsdl:operation>
    <wsdl:operation name="getOperationDescs">
      <wsdl:input name="getOperationDescsRequest" 
message="intf:getOperationDescsRequest"/>
      <wsdl:output name="getOperationDescsResponse" 
message="intf:getOperationDescsResponse"/>
    </wsdl:operation>
    <wsdl:operation name="getOperationDescByName" parameterOrder="methodName">
      <wsdl:input name="getOperationDescByNameRequest" 
message="intf:getOperationDescByNameRequest"/>
      <wsdl:output name="getOperationDescByNameResponse" 
message="intf:getOperationDescByNameResponse"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="DemoServiceSoapBinding" type="intf:WebService">
    <wsdlsoap:binding style="rpc" 
transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="echoStringArray">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="echoStringArrayRequest">
        <wsdlsoap:body use="encoded" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
namespace="urn:SampleString"/>
      </wsdl:input>
      <wsdl:output name="echoStringArrayResponse">
        <wsdlsoap:body use="encoded" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
namespace="urn:SampleString"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="getOperationDescs">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="getOperationDescsRequest">
        <wsdlsoap:body use="encoded" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
namespace="urn:SampleString"/>
      </wsdl:input>
      <wsdl:output name="getOperationDescsResponse">
        <wsdlsoap:body use="encoded" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
namespace="urn:SampleString"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="getOperationDescByName">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="getOperationDescByNameRequest">
        <wsdlsoap:body use="encoded" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
namespace="urn:SampleString"/>
      </wsdl:input>
      <wsdl:output name="getOperationDescByNameResponse">
        <wsdlsoap:body use="encoded" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
namespace="urn:SampleString"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="WebServiceService">
    <wsdl:port name="DemoService" binding="intf:DemoServiceSoapBinding">
      <wsdlsoap:address 
location="http://slabsproj2:8080/axis/services/DemoService"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

I would appreciate any fixes to this bug or any changes that I need to make.

Thanks,
Saurabh