使用 Reporting Services 执行 Web 服务接收大型报告时出错
Error receiving large report using Reporting Services Execution Web service
我有一个将照片数据存储在数据库中的应用程序。 SSRS 报告用于生成与特定实体相关的照片报告。生成此报告所需的信息存储在单独的数据库中,并且非常简单地将 ReportId 与多张照片相关联。 Reporting Services 执行 Web 服务用于以 Word 格式呈现报表并输出字节数组,然后由应用程序使用。
问题是,有一个非常明确且可重复的大小限制,超过该限制应用程序将不会收到报告。在每种情况下,报告都已成功呈现,但从未根据 RS 日志发送响应:
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: HttpPipelineCallback::SendResponse(): failed writing response.
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: Failed with win32 error 0x0057, pipeline=0x0000027542592740.
httpruntime!ReportServer_0-1!1bfc!03/14/2018-21:46:48:: e ERROR: Failed in
BaseWorkerRequest::SendHttpResponse(bool), exception=System.ArgumentException: Value does not fall within the expected range.
at Microsoft.ReportingServices.HostingInterfaces.IRsHttpPipeline.SendResponse(Void* response, Boolean finalWrite, Boolean closeConn)
at ReportingServicesHttpRuntime.BaseWorkerRequest.SendHttpResponse(Boolean finalFlush)
library!ReportServer_0-1!1bfc!03/14/2018-21:46:48:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerHttpRuntimeInternalException: RsWorkerRequest::FlushResponse., Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerHttpRuntimeInternalException: An internal or system error occurred in the HTTP Runtime object for application domain ReportServer_SSRS_0-1-131655000672564770. ---> System.ArgumentException: Value does not fall within the expected range.
at ReportingServicesHttpRuntime.BaseWorkerRequest.SendHttpResponse(Boolean finalFlush)
at ReportingServicesHttpRuntime.RsWorkerRequest.FlushResponse(Boolean finalFlush)
--- End of inner exception stack trace ---;
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: HttpPipelineCallback::SendResponse(): failed writing response.
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: Failed with win32 error 0x10DD, pipeline=0x0000027542592740.
这似乎与服务 http 响应的某些大小限制直接相关,原因如下:
- 请求本身很小,只是一个Report Id 即httpRuntime maxRequestLength 没有关系,这个已经测试过了。
- 错误发生在请求的几分钟内,即与 httpRuntime executionTimeout 无关,这已经过测试。
- 我可以可靠且重复地将一张照片添加到报告中,但它会失败,删除一张照片,它可以毫无问题地渲染和发送,添加一张照片,它会失败...
- 渲染时间各不相同,因此它似乎与大小有关,而不是与超时有关。
- 无论是否发送报表,报表服务器执行日志显示每次渲染成功。
- 我使用通常调用报告的应用程序和单独的控制台应用程序重现了错误,该应用程序仅生成 Web 服务客户端并尝试使用 Render2 方法以字节数组形式呈现和接收报告。
- 我在多个不同的报表服务器上使用 SQL Server 2012 和 SQL Server 2016 重现了此错误,包括在本地设置报表服务器和 运行 服务器并请求在同一台机器上。
- 无论照片的组合如何,报告始终呈现成功但未能发送约 238,000,000 的字节数,即与某些不良数据无关。
- 在所有情况下,我都可以通过报表服务器门户生成相同大小或更大的报表,没有任何问题。
有没有人在使用 RS 网络服务时遇到过类似的行为?我在网上广泛搜索但没有任何运气。非常感谢任何有关如何解决此问题的建议。
Microsoft 最终将 HttpSendResponseEntityBody 确定为错误来源。该函数发送与 HTTP 响应关联的实体主体数据,并且根据 MSDN 具有以下参数:
EntityChunkCount [in] A number of structures in the array pointed to by pEntityChunks. This count cannot exceed 9999.
Microsoft 没有任何解决报表大小限制的 SSRS 文档。在这个阶段,他们所做的只是建议 "we can use other tools for this data extracting" 和 "generally we suggest put the data smaller than 100MB or the row counts less than 1,000,000".
我有一个将照片数据存储在数据库中的应用程序。 SSRS 报告用于生成与特定实体相关的照片报告。生成此报告所需的信息存储在单独的数据库中,并且非常简单地将 ReportId 与多张照片相关联。 Reporting Services 执行 Web 服务用于以 Word 格式呈现报表并输出字节数组,然后由应用程序使用。
问题是,有一个非常明确且可重复的大小限制,超过该限制应用程序将不会收到报告。在每种情况下,报告都已成功呈现,但从未根据 RS 日志发送响应:
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: HttpPipelineCallback::SendResponse(): failed writing response.
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: Failed with win32 error 0x0057, pipeline=0x0000027542592740.
httpruntime!ReportServer_0-1!1bfc!03/14/2018-21:46:48:: e ERROR: Failed in
BaseWorkerRequest::SendHttpResponse(bool), exception=System.ArgumentException: Value does not fall within the expected range.
at Microsoft.ReportingServices.HostingInterfaces.IRsHttpPipeline.SendResponse(Void* response, Boolean finalWrite, Boolean closeConn)
at ReportingServicesHttpRuntime.BaseWorkerRequest.SendHttpResponse(Boolean finalFlush)
library!ReportServer_0-1!1bfc!03/14/2018-21:46:48:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerHttpRuntimeInternalException: RsWorkerRequest::FlushResponse., Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerHttpRuntimeInternalException: An internal or system error occurred in the HTTP Runtime object for application domain ReportServer_SSRS_0-1-131655000672564770. ---> System.ArgumentException: Value does not fall within the expected range.
at ReportingServicesHttpRuntime.BaseWorkerRequest.SendHttpResponse(Boolean finalFlush)
at ReportingServicesHttpRuntime.RsWorkerRequest.FlushResponse(Boolean finalFlush)
--- End of inner exception stack trace ---;
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: HttpPipelineCallback::SendResponse(): failed writing response.
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: Failed with win32 error 0x10DD, pipeline=0x0000027542592740.
这似乎与服务 http 响应的某些大小限制直接相关,原因如下:
- 请求本身很小,只是一个Report Id 即httpRuntime maxRequestLength 没有关系,这个已经测试过了。
- 错误发生在请求的几分钟内,即与 httpRuntime executionTimeout 无关,这已经过测试。
- 我可以可靠且重复地将一张照片添加到报告中,但它会失败,删除一张照片,它可以毫无问题地渲染和发送,添加一张照片,它会失败...
- 渲染时间各不相同,因此它似乎与大小有关,而不是与超时有关。
- 无论是否发送报表,报表服务器执行日志显示每次渲染成功。
- 我使用通常调用报告的应用程序和单独的控制台应用程序重现了错误,该应用程序仅生成 Web 服务客户端并尝试使用 Render2 方法以字节数组形式呈现和接收报告。
- 我在多个不同的报表服务器上使用 SQL Server 2012 和 SQL Server 2016 重现了此错误,包括在本地设置报表服务器和 运行 服务器并请求在同一台机器上。
- 无论照片的组合如何,报告始终呈现成功但未能发送约 238,000,000 的字节数,即与某些不良数据无关。
- 在所有情况下,我都可以通过报表服务器门户生成相同大小或更大的报表,没有任何问题。
有没有人在使用 RS 网络服务时遇到过类似的行为?我在网上广泛搜索但没有任何运气。非常感谢任何有关如何解决此问题的建议。
Microsoft 最终将 HttpSendResponseEntityBody 确定为错误来源。该函数发送与 HTTP 响应关联的实体主体数据,并且根据 MSDN 具有以下参数:
EntityChunkCount [in] A number of structures in the array pointed to by pEntityChunks. This count cannot exceed 9999.
Microsoft 没有任何解决报表大小限制的 SSRS 文档。在这个阶段,他们所做的只是建议 "we can use other tools for this data extracting" 和 "generally we suggest put the data smaller than 100MB or the row counts less than 1,000,000".