!--- 如果这篇文章与其他一些帖子是多余的,我很抱歉,但我的项目的问题似乎是我的架构造成的,所以我需要一般帮助。---!
我正在尝试配置连接到 Silverlight 5 客户端的 WCF 服务和对数据库执行 CRUD 请求的 C# 类库。该服务将必须传递大量数据。例如,我的服务类中有一个公共 IList<RainRecord> GetAllRain()方法,它可以检索数据库中的数十万条记录,可能有一天会更多。所以我想我可以通过小批量获得所有这些记录(我认为这是一个很好的方法)。
这是我的 web.config 文件:
<?xml version="1.0" encoding="utf-8"?>
<!--This file contains the web configuration used by the WCF service. -->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" maxBatchGeneratedFileSize="2147483647" maxBatchSize="2147483647" />
<httpRuntime maxRequestLength="2147483647" />
</system.web>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
<serviceActivations>
<add service="PoseidonServiceNamespace.PoseidonService" relativeAddress="~/PoseidonService.svc"/>
</serviceActivations>
</serviceHostingEnvironment>
<bindings>
<basicHttpBinding>
<binding closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:10:00"
sendTimeout="00:01:00"
allowCookies="false"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
messageEncoding="Text"
textEncoding="utf-8"
transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None"
proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName"
algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="PoseidonServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="PoseidonServiceBehavior"
name="PoseidonServiceNamespace.PoseidonService">
<endpoint address="http://localhost:49455/PoseidonService.svc"
binding="basicHttpBinding"
contract="PoseidonServiceNamespace.IPoseidonService"/>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
我应该在这个文件中做哪些更改(为什么?),我应该如何在我的服务中实现我的公共 IList GetAllRain() 方法?
非常感谢,我一直在努力解决这个问题