|
|
|
|
|
|
|
|
|
|
|  |
| |
Friday, March 20 2009 @ 02:13 AM MDT Contributed by: admin Views:: 8,067 |
|
Solution 1:
When you deploy or try to open a report on the reporting services 2008 you may get an error "The underlying connection was closed: An unexpected error occurred on a send". How I solve this problem is that I check the reportserver.config file and make sure it is correct. The default value key SecureConnectionLevel may be set to 2, this will require SSL configuration. Where you do not need to use SSL you can turn it off and set it to 0. This will make the services unsecured but will work.
Solution 2:
If you are getting a similar error message for Web Services then try the following:
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send.
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 ...
You might have noticed that the first time you run the applicaton and it works fine but after a while when you run the second, third or forth it start to throw an exception as shown above. Usually if we alter the generated proxy class this problem is solved.
Go to the GetWebRequest function then make sure the KeepAlive property is set to false.
To do this try the following steps:
Add a Web Reference to your project
Make sure Show All Files menu item is enable in the Project menu.
- In the Solution Explorer window, navigate to:
- Web References
- <Name of your webservice>
- Open the Reference.cs file and add following code in the webservice proxy class:
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
System.Net.HttpWebRequest webRequest =
(System.Net.HttpWebRequest) base.GetWebRequest(uri);
webRequest.KeepAlive = false;
return webRequest;
}
Solution 3:
You might need to deploy using HTTPS and contain the same URL that is embedded in the SSL web server certificate.
TOOLS: TcpTrace
If after searching the web and you are still stuck, I suggest you download the tool tcpTrace and what the error is. They are really cool how it works is that it hook up between our client app and the webservice allowed us to see all the http traffic going back and forth. You will see the last activity or error before the connection is closed.
Download TcpTrace Now.
|
|
|
| |
|
|
|
|
|
|