2012-10-15 16 views
5

この質問は重複している可能性があります。クライアントが特定のファイルをサーバーにアップロードするWCFアップロードサービスがあります。リモートサーバーからエラーが返されました:(413)要求エンティティが大きすぎる+ WCF

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

これで、WCFサービスに自己認証済みのSSL証明書が統合されました。 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> 

おかげ

答えて

6

これは、HTTPS経由でWCFであまりにも大きな誤差を413要求エンティティを固定への切符であるように思わ

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

私はこの問題を追跡する私の午後の大半を費やした...ので、うまくいけば、これはあなたがアップし、固定れます、他の多くの提案がずっと私を助けにはならなかったが、これは確かでした。

+0

ありがとうございます!私の午後をちょうど救った! – nicojs

+0

これはSSLの問題でしかないようです。また、時間成分がある。私は、HTTPS要求の間に100秒を渡すことができれば、エラーが発生することがわかりました。 – nuander

関連する問題