471,582 Members | 1,344 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

System.Net.WebException: The underlying connection was closed:

Team,
From a windows service, we consume a web service on another server and
occasionally receive System.Net.WebException: The underlying connection was
closed:. For some clients we call, we do not see this as we ran into this
previoulsy, made a posting, and received some suggested code to resolved.
The code was put in their proxy classes and was this...
protected override WebRequest GetWebRequest(Uri uri)
{HttpWebRequest webRequest = (HttpWebRequest) base.GetWebRequest(uri);
webRequest.KeepAlive = false;
return webRequest; }
However, for the web service in question, we could not put that override
because it's proxy class inherits from class
Microsoft.Web.Services2.WebServicesClientProtocol (instead of
System.Web.Services.Protocols.SoapHttpClientProtoc ol ). Even though the code
builds ok - we recieve invalid cast exception at runtime on the first line.

Thus I either need a new solution for avoiding the System.Net.WebException:
The underlying connection was closed error as the original code snipet does
not work in proxy classes derived from
Microsoft.Web.Services2.WebServicesClientProtocol.
By the way we are deriving from
Microsoft.Web.Services2.WebServicesClientProtocol so we can send soap
security tokens in header.

Need soon! Thanks,
Tim
Nov 23 '05 #1
1 3255
Hi,

I think you are dealing with the issue of running out of 'connections'
from the connection pool.

Hope this helps,

Marvin Smit.

On Wed, 26 Oct 2005 17:46:02 -0700, Tim Reynolds
<ti**********@online.nospam> wrote:
Team,
From a windows service, we consume a web service on another server and
occasionally receive System.Net.WebException: The underlying connection was
closed:. For some clients we call, we do not see this as we ran into this
previoulsy, made a posting, and received some suggested code to resolved.
The code was put in their proxy classes and was this...
protected override WebRequest GetWebRequest(Uri uri)
{HttpWebRequest webRequest = (HttpWebRequest) base.GetWebRequest(uri);
webRequest.KeepAlive = false;
return webRequest; }
However, for the web service in question, we could not put that override
because it's proxy class inherits from class
Microsoft.Web.Services2.WebServicesClientProtoc ol (instead of
System.Web.Services.Protocols.SoapHttpClientProto col ). Even though the code
builds ok - we recieve invalid cast exception at runtime on the first line.

Thus I either need a new solution for avoiding the System.Net.WebException:
The underlying connection was closed error as the original code snipet does
not work in proxy classes derived from
Microsoft.Web.Services2.WebServicesClientProtocol .
By the way we are deriving from
Microsoft.Web.Services2.WebServicesClientProtoc ol so we can send soap
security tokens in header.

Need soon! Thanks,
Tim

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Kumar | last post: by
5 posts views Thread by Sachin Surana | last post: by
2 posts views Thread by zolof | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by lumer26 | 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.