Manifestation of the Error
If you attempt to connect to SSRS via the deployment webservice; when SSRS is running in SSL mode (specifically on port 443), you may get one of the following exceptions (which do not occur intermittently):
- The underlying connection was closed: An unexpected error occurred on a send.
- The operation has timed-out.
You might get it for other “The underlying connection was closed” errors, but I have not confirmed that. The issue occurs mainly when you try to upload report definitions that are over approximately 100kb.
The Solution
Let me tell you straight up – there is no reason to disable SSL or alter timeouts. The first thing you want to do is to add a new class to your project; I called mine SslReportService. Implement ReportingService2005 from your WebService reference. You can then override GetWebRequest(Uri) without worrying about your changes being lost of you update your web reference.
Then, in a nutshell:
class SslReportService : ReportService.ReportingService2005
{
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
var res = (HttpWebRequest)base.GetWebRequest(uri);
res.SendChunked = true;
return res;
}
}
Your mileage may vary; so if this turns up nothing Engels Rajangam has another helpful post on this issue. You might want to read up on this property on MSDN and a pretty good blog post.
2 Comments
Your solution worked perfect for me. Thank’s so much for your post.
I had spent a significant amount of time on this issue and am glad to not have to revert back to using a non ssl connection.
Glad it helped!