首页 技术 正文
技术 2022年11月11日
0 收藏 341 点赞 3,087 浏览 1846 个字

当遇到这个错误的时候郁闷了好长时间报错是字符串长度过大可是修改了MaxStringContentLength”属性的值却不起作用最后才发现还是因为配置文件配置的问题在服务端

格式化程序尝试对消息反序列化时引发异常: 尝试对参数 http://tempuri.org/ 进行反序列化时出错: GetLzdtArticleResult。InnerException 消息是“反序列化对象 属于类型 lzdt.DTO.Dtolzdt[] 时出现错误。读取 XML 数据时,超出最大字符串内容长度配额 (8192)。通过更改在创建 XML 读取器时所使用的 XmlDictionaryReaderQuotas 对象的 MaxStringContentLength 属性,可增加此配额

尽管我设置了“MaxStringContentLength”属性的值,但有这个错误…后来发现在服务端终结点配置上必须增加绑定配置属性 bindingConfiguration=”BasicHttpBinding_NewBind”才起作用 ,恍然大悟,记录博客备忘决不允许再犯这样低级的错误!!!!!!!!

<services>
      <service name=”Gps.OpenAPI.WebService.GpsWebService”  behaviorConfiguration=”liuyaokai_behavior”>
        <host>
          <baseAddresses>
            <add baseAddress=”http://localhost:13700/GpsWebService.svc”/>
          </baseAddresses>
        </host>
        <endpoint name=”BasicHttpBinding_IGpsWebService” address=”” binding=”basicHttpBinding” contract=”Gps.OpenAPI.WebService.IGpsWebService” bindingConfiguration=”BasicHttpBinding_NewBind”   />
        <endpoint address=”mex” binding=”mexHttpBinding” contract=”IMetadataExchange”/>
      </service>
    </services>

<basicHttpBinding>
      <binding name=”BasicHttpBinding_NewBind” closeTimeout=”00:05:00″ openTimeout=”00:05:00″ receiveTimeout=”00:10:00″ sendTimeout=”00:10: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=”2147483647″ maxArrayLength=”2147483647″ maxBytesPerRead=”409600″ maxNameTableCharCount=”2147483647″ />
        <security mode=”None”>
          <transport clientCredentialType=”None” proxyCredentialType=”None” realm=””/>
          <message clientCredentialType=”UserName” algorithmSuite=”Default”/>
        </security>
      </binding>
      </basicHttpBinding>

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,954
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,479
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,291
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,108
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,740
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,774