Logo

已超过传入消息(65536)的最大消息大小配额

photo

2016年08月30日

ce1e3a292df5e0fe8c4cf81b5e6034a85edf7250

这个问题常出现在调用WEBSERVICE的时候,造成的原因一般都是传入的字符超过预设的最大常量。

在客户端的webconfig文件的webservice节点进行如下配置:(注:此处客户端为应用程序的config文件)

<system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="DeviceServiceSoap"  maxBufferSize="2147483647"
                    maxReceivedMessageSize="2147483647"/>
            </basicHttpBinding>
            <customBinding>
                <binding name="DeviceServiceSoap12">
                    <textMessageEncoding messageVersion="Soap12" />
                    <httpTransport />
                </binding>
            </customBinding>
        </bindings>
        <client>
            <endpoint address="https://192.168.1.115:8081/DeviceService.asmx"
                binding="basicHttpBinding" bindingConfiguration="DeviceServiceSoap"
                contract="DeviceAgent.DeviceServiceSoap" name="DeviceServiceSoap" />
        </client>
    </system.serviceModel>

一般到这即可解决无法客户端接收数据的问题:若依然无法解决,可尝试下面代码,对服务器webservice的webconfig文件进行如下配置:

<system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    <bindings>
      <basicHttpBinding>
        <binding name="DBService"
         maxBufferPoolSize="2147483647"
         maxReceivedMessageSize="2147483647"
         maxBufferSize="2147483647">
          <readerQuotas maxArrayLength="2147483647"
                        maxBytesPerRead="2147483647"
                        maxDepth="2147483647"
                        maxNameTableCharCount="2147483647"
                        maxStringContentLength="2147483647"/>
        </binding>
      </basicHttpBinding>
    </bindings>
    <standardEndpoints>
      <webHttpEndpoint>
        <standardEndpoint name="webservice" maxReceivedMessageSize="4194304000"
          helpEnabled="true" automaticFormatSelectionEnabled="true" />
      </webHttpEndpoint>
    </standardEndpoints>
  </system.serviceModel>

橙子主题打折出售

其实我不卖,主要是这里是放广告的,所以就放了一个
毕竟主题都没做完,卖了也是坑.

购买它
所有附件
该文章没有附件.
本文为原创文章,请注意保留出处!

留言板

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

热门文章

WordPress 后台编辑器样式实现直接预览 在WordPress3.0以后,有一个新的实用功能:你可以更改默认后台编辑器(TinyMCE)的样...WordPress后台编辑器样式实现直接预览 作者:Pastore Antonio
1451 浏览量
【干货】Chrome插件(扩展)开发全攻略 写在前面我花了将近一个多月的时间断断续续写下这篇博文,并精心写下完整demo,写博客的辛苦大家懂的...【干货】Chrome插件(扩展)开发全攻略 作者:Pastore Antonio
1415 浏览量
CentOS 编译错误+配置错误解决方法集合 ERROR:theHTTPXSLTmodulerequiresthelibxml2/l...CentOS编译错误+配置错误解决方法集合 作者:Pastore Antonio
1409 浏览量
WordPress中加载JavaScript脚本的方法 在WordPress中加载脚本(为CSS和JS,下同)文件,大多数人的做法是直接在hea...WordPress中加载JavaScript脚本的方法 作者:Pastore Antonio
1385 浏览量
wordpress学习五: 通过wordpress_xmlrpc的python包远程操作wordpress wordpress提供了丰富的xmlrpc接口api来供我们远程操控wp的内容。伟大的开源社区有人就...wordpress学习五:通过wordpress_xmlrpc的python包远程操作wordpress 作者:Pastore Antonio
1382 浏览量