ReportExecutionService不遵守超时

时间:2017-07-25 14:10:08

标签: c# .net reporting-services ssrs-2008 system.net.webexception

我正在使用.NET ReportExecutionService来呈现SSRS报告。我们正在快速渲染许多报告,我们随机收到超时的报告。 1400个报告中约有1个会挂起。

当我检查ExecutionLog3中的挂起报告时,我看到状态为rsSuccess的报告,总时间约为3秒。所以它看起来像报告完成但渲染调用永远不会看到响应,并在5分钟后超时,出现以下异常:

    System.InvalidOperationException: There is an error in XML document (1, 2655). ---> System.Net.WebException: The operation has timed out.
   at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.IO.StreamReader.ReadBuffer(Char[] userBuffer, Int32 userOffset, Int32 desiredChars, Boolean& readToUserBuffer)
   at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count)
   at System.Xml.XmlTextReaderImpl.ReadData()
   at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars)
   at System.Xml.XmlTextReaderImpl.ParseText()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlTextReader.Read()
   at System.Xml.XmlReader.ReadElementString()
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read12_ReportParameter(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read17_ExecutionInfo(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read111_SetExecutionParametersResponse()
   at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer25.Deserialize(XmlSerializationReader reader)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   --- End of inner exception stack trace ---

如果有人对如何防止这些超时有任何建议我会很高兴尝试,但我认为现在更简单的解决方案是如果我能弄清楚如何在渲染调用上设置更短的超时。如果我可以超时并在30秒后重试报告,这仍然可以为我们提供所需的性能。

这是我的渲染调用。我需要更改什么超时选项才能在30秒后使此调用失败?

//tried setting the timeout in the constructor
var rsExec = new rsExecService.ReportExecutionService
{
       Url = string.Format("{0}{1}", url, executionServiceUrl), Timeout = 30000
};
//tried setting the timeout before calling render
rsExec.Timeout = 30 * 1000;
results = rsExec.Render(format, deviceInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);

0 个答案:

没有答案
相关问题