C#CS结构客户端,调用WEB服务时,2005、2008版报错超过字节数的错误

需要调整app.config文件

  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="WSLispClientSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
          receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
          bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="6553600" maxBufferPoolSize="524288" maxReceivedMessageSize="6553600"
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>

1、maxReceivedMessageSize、maxBufferSize默认的是65536,需要加大

2、上述两项必须大小相同,否则也报不一致的错误。

 

 

你可能感兴趣的:(Security,360,web服务,binding)