string的length方法(数组length方法)

C#客户端,调用别家的webservice,返回信息报错,摘取其中重要的如下:Themaximumstringcontentlengthquota(8192)hasbeenexceededwhilereadingXMLdata.ThisquotamaybeincreasedbychangingtheMaxStringContentLengthpro…

大家好,又见面了,我是你们的朋友全栈君。

C#客户端,调用别家的webservice,返回信息报错,摘取其中重要的如下:

The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property

不过这个问仅仅出现在Win XP系统,同样的调用在WIn 7和Win 10上没有出现。

这个问题曾经解决过,是通过修改配置文件,增加<readerQuotas>节点解决的。不过这次用“同样的方法”却问题依旧。

 经过一番探索,找到了办法,其实还是增加<readerQuotas>节点,但需要加在正确的<binding>节点中。正确的配置文件如下:

<basicHttpBinding>
    <binding name="sDataInfraceSoap" />
    <binding name="instrumentDockingServiceProviderServiceBinding">
			<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
				maxArrayLength="2147483647" maxBytesPerRead="2147483647"
				maxNameTableCharCount="2147483647" />
     </binding>
     <binding name="sDataInfraceSoap1" />
      <binding name="sDataInfraceSoap2" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" >
			<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
				maxArrayLength="2147483647" maxBytesPerRead="2147483647"
				maxNameTableCharCount="2147483647" />
	</binding>
    <binding name="StandardInterfaceSoap11Binding" />
</basicHttpBinding>

本项目比较特殊,一个软件集成了多个别家的webservice,所有配置文件里面的binding节点很多,这里就有四种:

sDataInfraceSoap

instrumentDockingServiceProviderServiceBinding

sDataInfraceSoap1

sDataInfraceSoap2

在<client>节点中确认一下报错的调用匹配的是哪一个binding:

<client>
      <endpoint address="http://aaa" binding="basicHttpBinding" bindingConfiguration="sDataInfraceSoap" contract="ServiceEtMobile.sDataInfraceSoap" name="sDataInfraceSoap" />
      <endpoint address="http://bbb" binding="basicHttpBinding" bindingConfiguration="sDataInfraceSoap1" contract="ServiceEtMobile2018.sDataInfraceSoap" name="sDataInfraceSoap1" />
      <endpoint address="http://xxx" binding="basicHttpBinding" bindingConfiguration="instrumentDockingServiceProviderServiceBinding" contract="ServiceZYD.instrumentDockingServiceProvider" name="instrumentDockingServiceProviderService" />
      <endpoint address="http://kkk" binding="basicHttpBinding" bindingConfiguration="sDataInfraceSoap2" contract="ServiceEtMobile2.sDataInfraceSoap" name="sDataInfraceSoap2" />
      <endpoint address="http://iii" binding="basicHttpBinding" bindingConfiguration="StandardInterfaceSoap11Binding" contract="ServiceJSSYJ_STD_Test.StandardInterfacePortType" name="StandardInterfaceHttpSoap11Endpoint" />
      <endpoint address="http://ttt" binding="customBinding" bindingConfiguration="StandardInterfaceSoap12Binding" contract="ServiceJSSYJ_STD_Test.StandardInterfacePortType" name="StandardInterfaceHttpSoap12Endpoint" />
</client>

也就是说,<readerQuotas>节点要加在对应的binging节点中才有效。当然,笨办法就是几个binding节点都加上。

问题解决。

 

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/127559.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • GridSplitter

    GridSplitter

    2021年9月13日
    74
  • pycharm创建flask项目没有子文件夹和app文件_python flask框架

    pycharm创建flask项目没有子文件夹和app文件_python flask框架打开Pycharm的File菜单,选择创建新的项目,在弹出对话框中,我们可以看到很多的案例,Flask、Django等等,我们选择Flask创建Flask项目。选择创建之后一个Flask项目就出现在我们眼前:默认文件目录结构为:app.py程序入口,static用于存放静态文件,如js、css、img等,templates用于放置html模板文件在Pycharm菜单栏有个run,我们可以选择run来启动Flask服务,默认打开的是5000端口打开浏览器输入http://lo.

    2022年8月29日
    2
  • How do I obtain a Digital Certificate from my Certificate Authority (CA)?

    How do I obtain a Digital Certificate from my Certificate Authority (CA)?

    2021年6月20日
    95
  • 一看就懂:正则表达式[通俗易懂]

    一看就懂:正则表达式[通俗易懂]案例引入在讲正则表达式前,我们不妨先从一个场景来逐渐引入。你可能有过这样的经历:我们去某些网站注册帐号,当你在设置密码的时候,网站会提示你密码的长度范围,以及对应的规则限制(如下图)。根据上图,我们将密码设置规则可以描述为两个条件:(1)长度为6-16位;(2)密码中必须包含数字,大写字母,小写字母,特殊字符(指定字符);现在假设我们不知道正则表达式,作为程序员的你,该如何去实现这样一个密码验证呢?下面是我写的一个校验方法(样本):/***校验用户密码是否满足..

    2022年5月13日
    55
  • jquery 用于操作动态元素的delegate/on方法

    jquery 用于操作动态元素的delegate/on方法delegate()方法的事件处理程序适用于当前或未来的元素(比如由脚本创建的新元素)。在做项目中有很多由ajax动态生成的html标签,jquery对这些标签不会响应$(selector).click(function..或者$(selector).bind(‘click’,function..,。查看资料有的推荐使用live方法,但live在jQuery1.7中就不再建议使用,在1

    2022年10月21日
    0
  • 【ThinkingInJava】6、测试自己的输出类库

    【ThinkingInJava】6、测试自己的输出类库/***书本:《ThinkingInJava》*功能:定制工具库,用于System.out.println的简化*文件:Print.java*时间:2014年10月7日19:45:31*作者:cutter_point*/packagenet.mindview.util;importjava.io.*;importjavax.print.attribute.

    2022年7月9日
    15

发表回复

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

关注全栈程序员社区公众号