使用 OData WCF Data Services 和 Excel PowerPivot 发布的大型数据集
我想发布一个 SQL Server 数据库,用于测试目的 AdventureWorksDW
,这是 Microsoft 提供的数据仓库示例数据库。我在 VS 中创建了一个新的“WCF 数据服务”项目,并创建了一个实体框架模型以将其传递到 DataService 基类的通用参数中。我在模型中包含了一些维度和事实表FactInternetSales
。默认情况下,FactInternetSales 表包含太多数据(60398 条记录),无法通过 OData 访问。当我尝试从控制台应用程序迭代 FactInternetSales 实体集时,我收到带有以下消息的 System.Net.WebException
:
底层连接已关闭:连接意外关闭。
如果我限制要迭代的行数,比如 1000,我就没有问题。
另一方面,当我尝试使用此 OData 服务将数据从 FactInternetSales 加载到 PowerPivot 时,我收到以下错误消息:
无法获取数据源“FactInternetSales”的架构。请确保此 Feed 存在。
在OData服务的InitializeService
方法中,我设置了config.SetEntitySetPageSize("*", 1000000)
,但它似乎没有任何效果。我还在服务的 web.config 中添加了以下代码,但没有成功:
<system.web>
...
<httpRuntime maxRequestLength="40960" />
</system.web>
...
<system.webServer>
<security>
<requestFiltering allowDoubleEscaping="true">
<requestLimits maxAllowedContentLength="2147483647" />
</requestFiltering>
</security>
</system.webServer>
我想这是一个配置问题,允许这么多数据流过 OData 服务,但我找不到应该更改的好地方默认行为。
I want to publish an SQL Server database, for testing purposes AdventureWorksDW
, the data warehouse sample database that provides Microsoft. I created a new "WCF Data Service" project in VS and created an Entity Framework Model to pass it into the generic parameter of DataService
base class. I included in the model some dimensions and the facts table FactInternetSales
. It seem that FactInternetSales table contains too much data (60398 records) to be accessed through OData by default. When I try to iterate the FactInternetSales entity set from a console app, I get an System.Net.WebException
with the message:
The underlying connection was closed: The connection was closed unexpectedly.
If I limit the numbers of rows to iterate, said 1000, I have not problem.
On the other hand, when I try to load the data from FactInternetSales into PowerPivot using this OData Service, I get this error message:
Unable to obtain schema for data feed 'FactInternetSales'. Please make sure this feed exists.
In the InitializeService
method of the OData Service I have set config.SetEntitySetPageSize("*", 1000000)
, but it seem don't have any effect. I added also the following code to the service's web.config, without success:
<system.web>
...
<httpRuntime maxRequestLength="40960" />
</system.web>
...
<system.webServer>
<security>
<requestFiltering allowDoubleEscaping="true">
<requestLimits maxAllowedContentLength="2147483647" />
</requestFiltering>
</security>
</system.webServer>
I guess it is a matter of configuration to allow this amount of data flow through the OData Service, but I can't find tho good place where I should change the default behavior.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论