Hi;

 

I have a case where I have created a java web service using Axis setting the SOAP in doc/literal format. My java client can access it fine. My C# client throws an exception. Also, as the SOAP packets below show – two very weird things:

  1. The C# requests have no method name. This clearly is a major problem but why did wsdl.exe not create one and how do I fix this?
  2. The response to the C# client has a 1ec before and a 0 after the SOAP packet. This has occurred all 3 times I tried it – yet no extra chars for the java client response.

 

******************

The SOAP for the C# Request (sent by C# client):

POST /axis/services/WindwardReports HTTP/1.1

VsDebuggerCausalityData: Aw{…lots of A’s…}AA

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.1.4322.573)

Content-Type: text/xml; charset=utf-8

SOAPAction: ""

Content-Length: 236

Expect: 100-continue

Connection: Keep-Alive

Host: 127.0.0.1:1234

 

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xmlns:xsd="http://www.w3.org/2001/XMLSchema">

      <soap:Body />

</soap:Envelope>

 

The SOAP for the C# Response (returned by java web service):

HTTP/1.1 100 Continue

 

HTTP/1.1 500 Internal Server Error

Set-Cookie: JSESSIONID=2A813F0FBC668645B9AD3F11E862B92D; Path=/axis

Content-Type: text/xml;charset=utf-8

Transfer-Encoding: chunked

Date: Sat, 17 Jul 2004 23:21:41 GMT

Server: Apache-Coyote/1.1

Connection: close

 

1ec

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

      xmlns:xsd="http://www.w3.org/2001/XMLSchema"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

      <soapenv:Body>

            <soapenv:Fault><faultcode>soapenv:Server.userException</faultcode>

                  <faultstring>java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0</faultstring>

                  <detail><ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">belle</ns1:hostname></detail>

            </soapenv:Fault>

      </soapenv:Body>

</soapenv:Envelope>

0

 

******************

The SOAP for the java Request (sent by java client):

POST /axis/services/WindwardReports HTTP/1.0

Content-Type: text/xml; charset=utf-8

Accept: application/soap+xml, application/dime, multipart/related, text/*

User-Agent: Axis/1.2beta2

Host: 127.0.0.1:1234

Cache-Control: no-cache

Pragma: no-cache

SOAPAction: ""

Content-Length: 245

<soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/

xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Body>

<getVersion xmlns=""/>

</soapenv:Body>

</soapenv:Envelope>

 

The SOAP for the java Response (returned by java web service):

HTTP/1.1 200 OK

Set-Cookie: JSESSIONID=26C2F2A0CF2A7C201B9FE4916F9D4B78; Path=/axis

Content-Type: text/xml;charset=utf-8

Date: Sat, 17 Jul 2004 23:34:58 GMT

Server: Apache-Coyote/1.1

Connection: close

<soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/

xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Body>

<getVersionReturn xmlns="urn:windward.net">3.2.1</getVersionReturn>

</soapenv:Body>

</soapenv:Envelope>

 

******************

The exception thrown is:

+          System.SystemException          {"java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0"}            System.SystemException

 

It is happening on the call:

            object[] results = this.Invoke("getVersion", new object[0]);

 

The code (with extra stuff removed) is:

  [System.Diagnostics.DebuggerStepThroughAttribute()]

  [System.ComponentModel.DesignerCategoryAttribute("code")]

  [System.Web.Services.WebServiceBindingAttribute(Name="WindwardReportsSoapBinding", Namespace="urn:windward.net")]

  public class CreateReportService : System.Web.Services.Protocols.SoapHttpClientProtocol {

       

    public CreateReportService() {

      this.Url = "">

    }

 

    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]

    [return: System.Xml.Serialization.XmlElementAttribute("getVersionReturn", Namespace="urn:windward.net")]

    public string getVersion() {

      object[] results = this.Invoke("getVersion", new object[0]);

      return ((string)(results[0]));

}

  }

 

Any ideas? Again, this works fine with a java client. Both java server & client created with axis wsdl2java. C# code created with .net wsdl.exe.

 

Thanks - dave

 

Ps – my wsdl is attached

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:windward.net" xmlns:apachesoap="http://xml.apache.org/xml-soap"; xmlns:impl="urn:windward.net" xmlns:intf="urn:windward.net" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
<!--WSDL created by Apache Axis version: 1.2beta2
Built on Jul 16, 2004 (12:01:53 PDT)-->
 <wsdl:types>
  <schema elementFormDefault="qualified" targetNamespace="urn:windward.net" xmlns="http://www.w3.org/2001/XMLSchema";>
   <element name="in0" type="xsd:base64Binary"/>
   <complexType name="ReportProperties">
    <sequence>
     <element name="type" type="xsd:int"/>
    </sequence>
   </complexType>
   <element name="in1" type="impl:ReportProperties"/>
   <complexType name="ReportDataSources">
    <sequence>
     <element name="file" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
   <complexType name="ArrayOfReportDataSources">
    <sequence>
     <element maxOccurs="unbounded" minOccurs="0" name="item" nillable="true" type="impl:ReportDataSources"/>
    </sequence>
   </complexType>
   <element name="in2" type="impl:ArrayOfReportDataSources"/>
   <complexType name="ReportResults">
    <sequence>
     <element name="numPages" type="xsd:int"/>
     <element name="report" type="xsd:base64Binary"/>
    </sequence>
   </complexType>
   <element name="processReturn" type="impl:ReportResults"/>
   <element name="getVersionReturn" type="xsd:string"/>
  </schema>
 </wsdl:types>

   <wsdl:message name="processResponse">

      <wsdl:part element="impl:processReturn" name="processReturn"/>

   </wsdl:message>

   <wsdl:message name="processRequest">

      <wsdl:part element="impl:in0" name="in0"/>

      <wsdl:part element="impl:in1" name="in1"/>

      <wsdl:part element="impl:in2" name="in2"/>

   </wsdl:message>

   <wsdl:message name="getVersionRequest">

   </wsdl:message>

   <wsdl:message name="getVersionResponse">

      <wsdl:part element="impl:getVersionReturn" name="getVersionReturn"/>

   </wsdl:message>

   <wsdl:portType name="CreateReport">

      <wsdl:operation name="process" parameterOrder="in0 in1 in2">

         <wsdl:input message="impl:processRequest" name="processRequest"/>

         <wsdl:output message="impl:processResponse" name="processResponse"/>

      </wsdl:operation>

      <wsdl:operation name="getVersion">

         <wsdl:input message="impl:getVersionRequest" name="getVersionRequest"/>

         <wsdl:output message="impl:getVersionResponse" name="getVersionResponse"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="WindwardReportsSoapBinding" type="impl:CreateReport">

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

      <wsdl:operation name="process">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="processRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="processResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="getVersion">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="getVersionRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="getVersionResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="CreateReportService">

      <wsdl:port binding="impl:WindwardReportsSoapBinding" name="WindwardReports">

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

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>

Reply via email to