小编Dam*_*ski的帖子

WCF为大请求返回404,maxReceivedMessageSize ="2147483647"

我们对大型请求的WCF服务返回以下错误:

"System.ServiceModel.EndpointNotFoundException:http://xxx.svc上没有可以接受消息的端点.这通常是由不正确的地址或SOAP操作引起的.有关更多详细信息,请参阅InnerException(如果存在). - > System.Net.WebException:远程服务器返回错误:(404)Not Found.

对于小请求,一切正常,我从WCF服务得到正确的响应,问题仅在于大量请求.

客户端上的设置如下:

 <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_ITestService" openTimeout="00:05:00" sendTimeout="00:05:00" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" >
          <readerQuotas maxDepth="2147483647" maxBytesPerRead="2147483647" maxArrayLength="2147483647" maxStringContentLength="2147483647"
            maxNameTableCharCount="2147483647"/>
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost:33333/TestService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ITestService" contract="TestService.ITestService" name="BasicHttpBinding_ITestService" />
    </client>
  </system.serviceModel>
Run Code Online (Sandbox Code Playgroud)

WCF服务的设置:

 <bindings>
      <basicHttpBinding>
        <binding maxReceivedMessageSize="2147483647" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferSize="2147483647" maxBufferPoolSize="2147483647">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483646" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
        </binding>
      </basicHttpBinding>
    </bindings>
Run Code Online (Sandbox Code Playgroud)

可能是什么问题?

wcf

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

标签 统计

wcf ×1