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)
上一篇 2022年4月10日 上午6:00
下一篇 2022年4月10日 上午6:00


相关推荐

  • matlab 符号卷积,教你用matlab快速解决烦人的符号变换(Fourier、Laplace和 z 变换)和符号卷积…

    matlab 符号卷积,教你用matlab快速解决烦人的符号变换(Fourier、Laplace和 z 变换)和符号卷积…目录 bash 符号卷积 code 备注 blog 符号变换 Fourier 变换及其反变换 fourier 是算符号表达式的傅里叶变换的 算出来结果要画图能够用 ezplot it 例 1 求的 Fourier 变换 classmatlab 代码 变量 傅里叶变换 symstwut heaviside t UT fourier ut 结果 UT pi dirac w i w 傅里叶反变换 Ut

    2026年3月17日
    2
  • 常见的RuntimeException

    常见的RuntimeException常见的RuntimeException                    RuntimeException是开发中最容易遇到的,下面列举一下常见的RuntimeException:1、NullPointerException:见的最多了,其实很简单,一般都是在null对象上调用方法了。   Strings=null;   bo…

    2022年7月25日
    17
  • python中的ideavim有什么作用_IdeaVim插件施用技巧

    python中的ideavim有什么作用_IdeaVim插件施用技巧IdeaVim插件使用技巧在IDEAIntellij小技巧和插件一文中简单介绍了一下IdeaVim插件。在这里详细总结一下这个插件在日常编程中的一些常用小技巧。供有兴趣使用这个插件,但对Vim还不十分熟悉的朋友参考。当然基本的hjkl移动光标和几种常见模式等等基本概念就略过不提了。为了确保只包含常用操作,这里提到的技巧都没有从现成文档里抄,而是凭记忆列出(不常用自然就不记得了)。估计会有所遗…

    2022年10月1日
    6
  • 如何学分子模拟的软件

    如何学分子模拟的软件当今分子模拟已经成为很多领域学术研究的主流方法。多年前,因为计算量的原因,很多情况下,MC方法是首选,特别是只关心平衡体系,关心相边界行为的时候。随着计算资源的增加、计算成本的降低、一些研究对象的平衡态的体系已经几乎被做烂了,科研工作者慢慢关心动力学行为,非平衡特征,致力于发现新的现象,新的物理规律(总要有事做,有饭吃吧),于是MD越来越普及,用的人也越来越多。除了极端的方法学工作者,一般情况下…

    2022年5月26日
    34
  • Nginx停止服务和各种命令

    Nginx停止服务和各种命令1 停止 Nginx 服务的四种方法从容停止服务这种方法较 stop 相比就比较温和一些了 需要进程完成当前工作后再停止 nginx squit 立即停止服务这种方法比较强硬 无论进程是否在工作 都直接停止进程 nginx sstopsystemc 停止 systemctl 属于 Linux 命令 systemctlsto servicekilla

    2026年3月20日
    2
  • 微信小程序调用支付接口支付失败_微信小程序与后端的接口

    微信小程序调用支付接口支付失败_微信小程序与后端的接口我前段时间做微信支付,遇到了很多坑,网上也没有讲解的特别明白的,通过借鉴各路人才的经验,最后也完成了,网上有很多讲解,我在这只讲一些注意点和解决的方法。我就讲讲我从完全懵到完成的过程吧。在微信提供的接口文档中提供了一个微信支付接口,应该是直接调用这个接口就可以发起微信支付文档路径:https://developers.weixin.qq.com/miniprogram/dev/api/ap…

    2025年12月12日
    5

发表回复

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

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