捕捉到 System.ServiceModel.ProtocolException
  Message=远程服务器返回了意外响应: (400) Bad Request。
          InnerException: 
我的一个类里面如果那个byte[]数组大了就报这个错误, 小了就可以。 大致超过4k左右。 就报错

解决方案 »

  1.   

    大的数组byte[] 是返回值吗?如果是有些参数需要在config中配置。
    我不是很确认是这个原因,因为如果那些参数不够大,应该返回详细的异常信息,而不是400(Bad Request) <binding name="WilcomDesignCreationServiceSoap" closeTimeout="00:03:00"
              openTimeout="00:03:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
              allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
              maxBufferSize="6553600" maxBufferPoolSize="52428800" maxReceivedMessageSize="6553600"
              messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
              useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="8192000" maxArrayLength="163840000"
                maxBytesPerRead="4096000" maxNameTableCharCount="163840000" />

              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </binding>
      

  2.   

    绑定方式, 不要使用wsHttpBinding,这种方式最大就是4k
      

  3.   

    那用哪个配置啊,wsHttpBinding这个不行!用哪个?