Hi all,
I am coding a web service for the company I am working for. It supposes to
talk to a third-party web service, via WSDL. The web reference which I am
using is:
http://xml.nig.ac.jp/wsdl/SRS.wsdl
My code to test the web service is the following: (VS.net2003 C#)
private string QuerySRS(string queryString)
{
SRS search = new SRS();
string query = "[swissprotrelease-AllText:"+queryString+"]";
string param = "-f ID";
try
{
string results = search.searchSimple(query);
……………………………
}
catch
{
}
}
Trying to run this class, I got the error in below:
System.Net.WebException: The underlying connection was closed: An
unexpected error occurred on a receive. at
System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest
request) at
System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse
(WebRequest request) at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters) at
EBIResearch.jp.ac.nig.xml.SRS.searchSimple(String query)
And,
string results = search.searchSimple(query).ToString();
is the line causing the problem, which means I got no response back from
the remove web service.
I have tried to add the following function in the Reference.cs, but still
got the same problem.
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
System.Net.HttpWebRequest webRequest =
(System.Net.HttpWebRequest) base.GetWebRequest(uri);
webRequest.KeepAlive = false;
return webRequest;
}
I knew this is a common asked question, but any suggestions are welcome.
Thanks
Rui
GuyV - 24 May 2005 03:03 GMT
I've test your Web service on framework 1.1.4322 with C#, console
application. (without VS.NET)
first, I made proxy class for your WSDL and compile. (wsdl.exe util in SDK
dir)
and code:
SRS search = new SRS();
string query = "[swissprotrelease-AllText:]";
string results = search.searchSimple(query);
Console.WriteLine(results);
I can't see any error/Exception([results' is empty value).
I think there're no prob in Web service.
Check your vs.net application.
----------------------------
GuyV
> Hi all,
> I am coding a web service for the company I am working for. It supposes to
[quoted text clipped - 54 lines]
> Thanks
> Rui