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>
所有附件
该文章没有附件.
本文为原创文章,请注意保留出处!

留言板

发表回复

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

热门文章

修复群晖Synology Drive client右键菜单缺失问题 本教程主要解决windows10右键菜单中没有SynologyDrive菜单的问题,整体思路是找到...修复群晖SynologyDriveclient右键菜单缺失问题 作者:Pastore Antonio
1816 浏览量
docker如何查看一个镜像内部的目录结构及其内部都有哪些文件 前言:有时候我们会在docker上下载一个镜像,或者是上传一个镜像到docker上,甚至有时候就是在...docker如何查看一个镜像内部的目录结构及其内部都有哪些文件 作者:Pastore Antonio
1801 浏览量
configure: error: Package requirements (oniguruma) were not met configure:error:Packagerequirements(oniguruma)...configure:error:Packagerequirements(oniguruma)werenotmet 作者:Pastore Antonio
1532 浏览量
Adobe Acrobat Pro 激活 这里记录了一些AdobeAcrobat的激活教程和组件。浏览量:1,685 作者:Pastore Antonio
1531 浏览量
追寻日出,找回自己 为什么我要去追寻日出?其实我是一个很懒的人,每次都起不来,直到有一次我在租房中睡到了大天亮,阳光照...追寻日出,找回自己 作者:Pastore Antonio
1508 浏览量