-1

我在尝试传输大于 50kb 的文件时遇到同样的问题,错误消息是“(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> 
4

1 回答 1

0

Make sure the web.config on the server has the following setting:

<system.web>
    <httpRuntime maxRequestLength="2147483647" />
    ....
</system.web>
于 2012-09-12T19:43:51.767 回答