调用WCF返回请求实体太大

时间:2014-02-12 11:03:54

标签: c# wcf web-services entity-framework wcf-binding

我知道这已被问过几次但是我已经按照给定的解决方案仍然得到了错误。

我有一个WCF Web服务库,一个WCF Web服务主机应用程序和一个使用这些服务的Windows窗体应用程序。

表单应用具有此App.Config的主机应用程序的服务引用....

    <system.serviceModel>
    <bindings>
        <basicHttpBinding>
          <binding name="BWData" maxBufferPoolSize="2147483647"
                maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
            <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
                maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://localhost:58045/BWService.svc/bwd"
            binding="basicHttpBinding" bindingConfiguration="BWData" contract="BWServiceReference.IBws"
            name="BWData" />
    </client>
</system.serviceModel>

主机应用程序 Web.Config ....

    <bindings>
  <basicHttpBinding>
    <binding name="BWSBinding" openTimeout="00:10:00" maxBufferPoolSize="2147483646"
      maxBufferSize="2147483646" maxReceivedMessageSize="2147483646">
      <readerQuotas maxDepth="2147483646" maxStringContentLength="2147483646"
        maxArrayLength="2147483646" maxBytesPerRead="2147483646" maxNameTableCharCount="2147483646" />
    </binding>
  </basicHttpBinding>
</bindings>
<services>
  <service name="MyApp.Business.WebServices.Bws">
    <endpoint address="bwd" binding="basicHttpBinding" bindingConfiguration="BWSBinding"
      name="BWData" contract="MyApp.Business.WebServices.IBws" />
    <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
      contract="IMetadataExchange" />
  </service>
</services>

使用SVC文件......

<%@ ServiceHost Language="C#" Debug="true" Service="MyApp.Business.WebServices.Bws" %>

WCF服务库 App.Config ....

   <services>
  <service name="MyApp.Business.WebServices.Bws">
    <endpoint address="" binding="basicHttpBinding" contract="MyApp.Business.WebServices.IBws">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8733/Design_Time_Addresses/MyApp.Business.WebServices/Service1/" />
      </baseAddresses>
    </host>
  </service>
</services>

我将大List<t>传递给使用EF将记录添加到数据库的Web服务。任何人都可以看到我失踪了吗?

0 个答案:

没有答案