C# generated .NET stubs break on a null return of a complex object

From: Dan A (A_at_discussions.microsoft.com)
Date: 02/08/05

  • Next message: Dan A: "Why can't .NET generate wrappers for exceptions (WSDL faults)"
    Date: Tue, 8 Feb 2005 13:13:10 -0800
    
    

    I have a SOAP written in Java, and being served by Apache Axis - using the
    wrapped mode. I then used VS 2003 to generate C# client stubs.

    I have many complex types that are returned - and these work fine for the
    most part.

    The current problem I have (Which appears to be a bug with .NET - but I
    can't seem to find a place to report .NET bugs without paying money) is that
    when I call a method that returns an array of one of my own complex object
    types - and the resulting array is empty - .NET throws a very nasty
    SOAPException that actually has nothing to do with the problem.

    When I make this same call with my java client - here is the SOAP message
    that is sent to the server:

    <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>
        <lookupConceptCodesByDesignation xmlns="urn://hl7.org/CTSVAPI">
    <codeSystem_id>ne=uri:iso:2.16.840.1.113883.6.2/PROC,ra=HL7</codeSystem_id>
          <matchText>Appendix</matchText>
          <matchAlgorithm_code>StartsWithIgnoreCase</matchAlgorithm_code>
          <language_code xsi:nil="true" />
          <activeConceptsOnly>false</activeConceptsOnly>
          <timeout>15000</timeout>
          <sizeLimit>50</sizeLimit>
        </lookupConceptCodesByDesignation>
      </soapenv:Body>
    </soapenv:Envelope>

    And here is the response:

    <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>
        <lookupConceptCodesByDesignationResponse xmlns="urn://hl7.org/CTSVAPI" />
      </soapenv:Body>
    </soapenv:Envelope>

    As you can see, the response object is basically empty - because there were
    no results. The java code actually returned an empty array - and this is the
    SOAP message that was generated.

    When .NET receives this message - rather than giving me a null or empty
    array of ConceptId objects, as it should - it throws this exception:

    System.Web.Services.Protocols.SoapException: Tried to invoke method public
    org.hl7.CTSVAPI.ConceptId[]
    org.hl7.CTSVAPI.sql.refImpl.BrowserOperationsImpl.lookupConceptCodesByDesignation(java.lang.String,java.lang.String,java.lang.String,java.lang.String,boolean,int,int)
    throws
    org.hl7.CTSVAPI.BadlyFormedMatchText,org.hl7.CTSVAPI.UnknownCodeSystem,org.hl7.CTSVAPI.UnknownLanguageCode,org.hl7.CTSVAPI.UnexpectedError,org.hl7.CTSVAPI.TimeoutError,org.hl7.CTSVAPI.UnknownMatchAlgorithm
    with arguments
    java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.Boolean,java.lang.Integer,null.
     The arguments do not match the signature.; nested exception is:
            java.lang.IllegalArgumentException
       at
    System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
    methodName, Object[] parameters)
       at
    CTS_Demo.browser.BrowserOperationsService.lookupConceptCodesByDesignation(String
    codeSystem_id, String matchText, String matchAlgorithm_code, String
    language_code, Boolean activeConceptsOnly, Int32 timeout, Int32 sizeLimit) in
    c:\visual studio projects\ctsdemotool\cts demo\web
    references\browser\reference.cs:line 168
       at CTS_Demo.CTSDemo.search(String text) in c:\visual studio
    projects\ctsdemotool\cts demo\ctsdemo.cs:line 86

    Which as you can see, makes no sense whatsoever.
    I can provide more information as necessary - but I'm basically just trying
    to figure out how to report this error to the .NET developers.


  • Next message: Dan A: "Why can't .NET generate wrappers for exceptions (WSDL faults)"

    Relevant Pages

    • SAAJ response - invalid SOAP envelope
      ... SOAP message to a servlet. ... The client receives the response and writes its content to ...
      (comp.lang.java)
    • SOAP error
      ... I'm running Tomcat 3.2.4 with SOAP 2.2. ... I've deployed a small java ... The problem is that after invoking it's method i get a response with a ...
      (comp.lang.java.programmer)
    • deserialization arrays in Axis SOAP messages
      ... I have been trying to make requests of a web service provided by Axis using ... As a result of seraching news groups I guessed that the SOAP response ... defines an array element in a way that causes the dotnet deserialization ... I used SOAP extensions to manipulate the offending item in the SOAP ...
      (microsoft.public.dotnet.framework.webservices)
    • Re: SOAP Request is repeated in the SOAP response.
      ... Response all the parameters of the Request are described with the additional ... Client side method SaveMailcalls Server side SetMail. ... Parameters would be cSessionKey and cXML to the server side method. ... The structure of the SOAP ...
      (microsoft.public.fox.helpwanted)
    • Re: Repeated read From Socket is Truncated
      ... to return control back to the client code. ... Maybe the size of the response is fixed reads in data ... can't Java do that. ... int readSum = 0; ...
      (comp.lang.java.programmer)