Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / May 2005

Tip: Looking for answers? Try searching our database.

Not Solving "System.Net.WebException"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rui - 23 May 2005 00:32 GMT
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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.