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
- Previous message: B.J.: "Time-expensive methods calls and Web services"
- Messages sorted by: [ date ] [ thread ]
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.
- Previous message: B.J.: "Time-expensive methods calls and Web services"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|