|
-
September 20th, 2011, 07:09 PM
#31
Re: The underlying connection was closed: An unexpected error occurred on a receive.
Okay I think I might have a solution. A while ago I Google my issue and I needed to add this code to my References.cs. Do you know where that file is located at?
Code:
protected override WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest webRequest = (HttpWebRequest) base.GetWebRequest(uri);
webRequest.KeepAlive = false;
webRequest.ProtocolVersion=HttpVersion.Version10;
return webRequest;
}
Heres a link that talks about it: http://geekswithblogs.net/denis/arch.../16/50365.aspx
-
September 21st, 2011, 12:37 PM
#32
Re: The underlying connection was closed: An unexpected error occurred on a receive.
 Originally Posted by kytro360
Okay I think I might have a solution. A while ago I Google my issue and I needed to add this code to my References.cs. Do you know where that file is located at?
If you don't have a web service proxy, then you won't have a references.cs file.
You don't need to add this method, all you need to do is set up the HttpWebRequest properties the same when you create the object.
Btw, even though you aren't using a web service proxy so this doesn't apply in your case... in general, modifying the auto-generated proxy code is usually a bad idea (because every time you regenerate the code, you'll need to add back in the changes).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|