小编Mar*_*afe的帖子

如何使用EF 6为WCF数据服务(odata)设置配置文件

我有一个数据服务启动并运行,但我收到此错误:

远程服务器返回错误:(413)请求实体太大.

我已经尝试过许多方法来解决这个问题而没有运气.我已将网站上的uploadReadAheadSize和IIS中的数据服务设置为最大设置.我还为配置文件尝试了许多不同的设置.

这是客户端的当前app.config:

  <system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBinding_ILogging" />
    <binding name="WCFHttpBinding"
             maxReceivedMessageSize="2147483647"
             maxBufferSize="2147483647"
             maxBufferPoolSize="2147483647">
      <readerQuotas maxArrayLength="2147483647"
                    maxDepth="2147483647"
                    maxBytesPerRead="2147483647"
                    maxNameTableCharCount="2147483647"
                    maxStringContentLength="2147483647"/>
    </binding>
  </basicHttpBinding>
  <webHttpBinding>
    <binding name="WCFWebBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
    </binding>
  </webHttpBinding>
</bindings>
<client>
  <endpoint address="http://localhost/PSIDataService/PSIWcfDataService.svc"
            binding="webHttpBinding" bindingConfiguration="WCFWebBinding"
            name="WCFWebBinding" contract="*"/>
</client>
Run Code Online (Sandbox Code Playgroud)

我尝试了两种绑定,WCFWebBinding和WCFHttpBinding.

这是web服务web.config.

  <system.serviceModel>
<behaviors>
  <serviceBehaviors>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<bindings>
  <basicHttpBinding>
    <binding name="WCFHttpBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    </binding>
  </basicHttpBinding> …
Run Code Online (Sandbox Code Playgroud)

wcf wcf-data-services odata

3
推荐指数
1
解决办法
2229
查看次数

标签 统计

odata ×1

wcf ×1

wcf-data-services ×1