当前位置: 代码迷 >> Web Service >> 远程服务器返回了意外响应:(400)Bad Request。求解!该怎么处理
  详细解决方案

远程服务器返回了意外响应:(400)Bad Request。求解!该怎么处理

热度:111   发布时间:2016-05-02 02:25:23.0
远程服务器返回了意外响应:(400)Bad Request。求解!!!
访问WCF传递一个byte[]变量,如果值过大(13520字节)就报上面的错误,如果传递小一点的值(比如8751字节)就OK,按网上大家说的方法修改maxBufferSize的值也没用,具体配置文件相关章节内容如下:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IConfigMngWcfService" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="2147483647" maxBufferPoolSize="5242880000"
                    maxReceivedMessageSize="2147483647" messageEncoding="Text"
                    textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="819200"
                        maxArrayLength="1638400" maxBytesPerRead="409600" maxNameTableCharCount="1638400" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:6650/ShopLink/ConfigMngWcfService.svc"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IConfigMngWcfService"
                contract="ConfigMngWcfService.IConfigMngWcfService" name="BasicHttpBinding_IConfigMngWcfService" />
        </client>
    </system.serviceModel>
</configuration>
服务器端的也做了相应修改,但问题依旧,不知为何?
------解决方案--------------------

------解决方案--------------------
客户端服务端都修改
  相关解决方案