I am developing a web services client in .NET. The web services and their corresponding wsdl are hosted in a Tomcat web server. When I use the wsdl for generating a .NET proxy, .NET generates a proxy and properly binds it to the wsdl. However, when I run that proxy, the returned objects are always null. The returned message appears to be structurely correct and contains data in the returned elements.
I used the same wsdl with IIS as a web server on the local host, and .NET returns the data correctly.
I would greatly appreciate any help. Thanks.
Sasson Havusha
Attached are samples of the returned messages
-------------------------- Tomcat --------------------------------------------
ResponseCode: 200 (OK)
Content-Type:text/xml; charset="utf-8"
Content-Length:395
SOAPAction:""
Date:Sun, 21 Sep 2003 15:38:33 GMT
Server:Apache Coyote/1.0
<?xml version="1.0" encoding="utf-16"?>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap-env:Body>
<initializeResponse xmlns="http://www.idx.com/hco/services">
<initializeResult>
<HCOAccessKey>OK</HCOAccessKey>
</initializeResult>
</initializeResponse>
</soap-env:Body>
</soap-env:Envelope>
--------------------------------------------- .NET/IIS ---------------------------------------------------------
ResponseCode: 200 (OK)
Server:Microsoft-IIS/5.0
Date:Sun, 21 Sep 2003 15:27:28 GMT
X-Powered-By:ASP.NET
X-AspNet-Version:1.1.4322
Cache-Control:private, max-age=0
Content-Type:text/xml; charset=utf-8
Content-Length:383
<?xml version="1.0" encoding="utf-16"?>
<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>
<initializeResponse xmlns="http://tempuri.org/">
<initializeResult>
<HCOAccessKey>OK</HCOAccessKey>
</initializeResult>
</initializeResponse>
</soap:Body>
</soap:Envelope
Hi,
> The returned message appears to be structurely correct and
> contains data in the returned elements. I used the same wsdl
> with IIS as a web server on the local host, and .NET returns
> the data correctly.
Take a look at these two following fragments:
> <initializeResponse xmlns="http://www.idx.com/hco/services">
> <initializeResult>
> <HCOAccessKey>OK</HCOAccessKey>
> </initializeResult>
> </initializeResponse>
and
> <initializeResponse xmlns="http://tempuri.org/">
> <initializeResult>
> <HCOAccessKey>OK</HCOAccessKey>
> </initializeResult>
> </initializeResponse>
Did you see any difference? No?
Well, it seems that your client does not recognize the answer from Tomcat
due to it is in unknown namespace. The solution is to set attribute
[ResponseNamespace = "http://www.idx.com/hco/services"] over the
method, which has to retrieve this response.
Hope this help.
______________________________
With best wishes, Arthur Nesterovsky
Please visit my home page:
http://www.nesterovsky-bros.com
Sasson Havusha - 22 Sep 2003 16:58 GMT
Arthur,
Thank you for the tip. It does not solve the problem. This was one of the
first things I looked at. When .NET generates the proxy, it generates the
ResponseNamespace attribute which is derived from the wsdl. See below
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("",
RequestNamespace="http://www.idx.com/hco/services/",
ResponseNamespace="http://www.idx.com/hco/services/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return:
System.Xml.Serialization.XmlElementAttribute("initializeResult",
Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public HCOSessionHeader
initialize([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Sch
ema.XmlSchemaForm.Unqualified)] string user,
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSche
maForm.Unqualified)] string pass,
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSche
maForm.Unqualified)] string conn) {
object[] results = this.Invoke("initialize", new object[] {
user,
pass,
conn});
return ((HCOSessionHeader)(results[0]));
}
> Hi,
>
[quoted text clipped - 67 lines]
> Please visit my home page:
> http://www.nesterovsky-bros.com