远程服务器返回错误:(413) Request Entity Too Large + WCF [英] The remote server returned an error: (413) Request Entity Too Large + WCF

查看:25
本文介绍了远程服务器返回错误:(413) Request Entity Too Large + WCF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能这个问题是重复的.我有一个 WCF 上传服务,客户端通过该服务将特定文件上传到服务器.

May be this question is a duplicate. I have a WCF upload service through which the client uploads a particular file to the server.

我可以通过该服务成功发送大小为 12MB 的文件.

I could successfully send files of size 12MB through the service.

现在我已将自认证的 SSL 证书集成到 WCF 服务中.在没有 SSL 的情况下运行良好的同一个应用程序现在返回一个错误,指出远程服务器返回的错误 (413) 请求实体太大.

Now I have integrated a self certified SSL certificate to the WCF Service. The same application which was working fine without SSL now returns an error saying Remote server returned an error (413) request entity too large.

我该如何解决这个错误,这与 SSL 有关系吗?

how do I fix this error is this something to do with SSL ?

我哪里出错了.

<system.serviceModel>

<bindings>
  <basicHttpBinding>
    <binding name="customHttpBinding" openTimeout="00:10:00" sendTimeout="00:10:00"
     maxReceivedMessageSize="10067108864"
      messageEncoding="Mtom" transferMode="Streamed">          
      <security mode="Transport">
        <transport clientCredentialType="Certificate" />
      </security>
    </binding>
  </basicHttpBinding>
</bindings>

<behaviors>
  <serviceBehaviors>
    <behavior name="customServiceBehavior">
      <serviceMetadata httpsGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="true"/>

      <serviceCredentials>
        <clientCertificate>
          <authentication certificateValidationMode="PeerOrChainTrust" trustedStoreLocation="LocalMachine"/>
        </clientCertificate>
      </serviceCredentials>

    </behavior>
  </serviceBehaviors>
</behaviors>

<services>
  <service behaviorConfiguration="customServiceBehavior" name="FileTransferService">
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="customHttpBinding"
      contract="IFileTransferService" />
  </service>
</services>

谢谢

推荐答案

这似乎是修复 413 Request Entity too large 错误的票WCF over HTTPS

This seems to be the ticket to fixing the 413 Request Entity too large error with WCF over HTTPS

C:\Windows\System32\inetsrv>appcmd.exe set config "Default Web Site" -section:system.webServer/serverRunTime /uploadReadAheadSize:10485760 /commit:apphost

原因似乎与 IIS 如何通过 SSL 处理传入请求的身份验证有关.

The reason seems to be related to how IIS handles authentication of incoming requests over SSL.

另一个资源:http://blogs.msdn.com/b/jiruss/archive/2007/04/13/http-413-request-entity-too-large-can-t-上传大文件使用-iis6.aspx

我下午的大部分时间都在跟踪这个问题……许多其他建议对我没有多大帮助,但这确实有帮助,所以希望这能让你解决问题.

I just spent most of my afternoon tracking this problem down...many other suggestions didn't help me much but this certainly did, so hopefully this will get you fixed up.

这篇关于远程服务器返回错误:(413) Request Entity Too Large + WCF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆