471,348 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

WebService problem : The underlying connection was closed: An un..

Hello !
I have a WebService.
When I execute WS in browser on local machine - its OK!
When I execute WS in browser on the server machine /with remote desktop/ -
its OK!
When I execute WebService in WindowsForms app on the local machine /app and
WS/ - its OK !
But when I execute the Web service/server machine/ from WindowsForms app
/local machine/, it gives me this error :

" An unhandled exception of type 'System.Net.WebException' occurred in
system.web.services.dll
Additional information: The underlying connection was closed: An unexpected
error occurred on a receive. "

Do you know where is the problem and how can I fix it ???

Aug 2 '05 #1
2 1741
Hi u need to set keepalive=false in ur webrequest.Find the details in the
link below
which explains more...
www.dotnetforums.net/80674.html
http://cephas.net/blog/net

"Toma Marinov" wrote:
Hello !
I have a WebService.
When I execute WS in browser on local machine - its OK!
When I execute WS in browser on the server machine /with remote desktop/ -
its OK!
When I execute WebService in WindowsForms app on the local machine /app and
WS/ - its OK !
But when I execute the Web service/server machine/ from WindowsForms app
/local machine/, it gives me this error :

" An unhandled exception of type 'System.Net.WebException' occurred in
system.web.services.dll
Additional information: The underlying connection was closed: An unexpected
error occurred on a receive. "

Do you know where is the problem and how can I fix it ???

Aug 2 '05 #2
Hello again !
I try what you write to me, but the error is still the same ...
Here I paste code how I using it :

//Creating object with the WebService Uri
HttpWebRequest wr =
(HttpWebRequest)WebRequest.Create("http://.../webservices");
wr.KeepAlive = false;

s = new MyWebService ();
s.Timeout = -1;
str = s.MyWSmethod() // <--- here is the error

If I'm wrong with something - please write me...
Thank you in advance!
Toma

"Santhi Maadhaven" wrote:
Hi u need to set keepalive=false in ur webrequest.Find the details in the
link below
which explains more...
www.dotnetforums.net/80674.html
http://cephas.net/blog/net

"Toma Marinov" wrote:
Hello !
I have a WebService.
When I execute WS in browser on local machine - its OK!
When I execute WS in browser on the server machine /with remote desktop/ -
its OK!
When I execute WebService in WindowsForms app on the local machine /app and
WS/ - its OK !
But when I execute the Web service/server machine/ from WindowsForms app
/local machine/, it gives me this error :

" An unhandled exception of type 'System.Net.WebException' occurred in
system.web.services.dll
Additional information: The underlying connection was closed: An unexpected
error occurred on a receive. "

Do you know where is the problem and how can I fix it ???

Aug 2 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by David | last post: by
26 posts views Thread by Rajeev Tipnis | last post: by
1 post views Thread by Mahesh Devjibhai Dhola | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.