5

この質問は重複している可能性があります。クライアントが特定のファイルをサーバーにアップロードするWCFアップロードサービスがあります。

サービスを通じて12MBのサイズのファイルを正常に送信できました。

これで、自己認証SSL証明書をWCFサービスに統合しました。SSLなしで正常に動作していた同じアプリケーションが、リモートサーバーがエラー(413)要求エンティティが大きすぎることを返すというエラーを返すようになりました。

このエラーを修正するにはどうすればよいですか?これは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>

ありがとう

4

1 に答える 1

6

これは、WCFoverHTTPSでの413RequestEntityの大きすぎるエラーを修正するためのチケットのようです。

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

この理由は、IISがSSLを介した着信要求の認証を処理する方法に関連しているようです。

別のリソース: http: //blogs.msdn.com/b/jiruss/archive/2007/04/13/http-413-request-entity-too-large-can-t-upload-large-files-using-iis6 .aspx

私は午後のほとんどをこの問題の追跡に費やしました...他の多くの提案は私にはあまり役に立ちませんでしたが、これは確かに役立ちました。

于 2012-11-06T20:49:07.393 に答える