2012-09-12 54 views
-1

我試圖轉移比50kb的錯誤消息是較大的文件時,同樣的問題時請求「(400)錯誤的請求」(400)爲傳輸大文件

誰能告訴我在哪裏,我錯了?

下面的下面的代碼:

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <system.serviceModel> 


    <bindings> 
     <basicHttpBinding> 
     <binding name="BasicHttpBinding_IFileTransfer" closeTimeout="00:10:00" 
      openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" 
      allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
      maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" 
      messageEncoding="Text" transferMode="Buffered" 
      useDefaultWebProxy="true"> 
      <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" 
      maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
      <security mode="None"> 
      <transport clientCredentialType="None" proxyCredentialType="None" 
       realm="" /> 
      <message clientCredentialType="UserName" algorithmSuite="Default" /> 
      </security> 
     </binding> 
     </basicHttpBinding> 
    </bindings> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" /> 
    <client> 

     <endpoint address="http://localhost:57728/FileTransfer.svc" binding="basicHttpBinding" 
    bindingConfiguration="BasicHttpBinding_IFileTransfer" contract="WCFFileTransfer.IFileTransfer" 
    name="BasicHttpBinding_IFileTransfer" /> 

    </client> 


    </system.serviceModel> 
</configuration> 
+5

打開WCF跟蹤上(http://msdn.microsoft.com /en-us/library/ms733025.aspx)。這真的有幫助。 – Dennis

+0

+1對於WCF跟蹤。另外,你的服務器配置是什麼樣的? – MStodd

+0

歡迎來到Stackoverflow。對於一個問題,這不是一個有用的標題。請嘗試更具體。 –

回答

0

確保服務器上的Web.config具有以下設置:

<system.web> 
    <httpRuntime maxRequestLength="2147483647" /> 
    .... 
</system.web>