问题描述,在调用接口报错:
格式化程序尝试对消息反序列化时引发异常:
尝试对参数 http://tempuri.org/ 进行反序列化时出错: GetRechargeInfoListResponse。InnerException 消息是“反序列化对象 属于类型 ServiceReference.GetRechargeInfoListResponseBody 时出现错误。
读取 XML 数据时,超出最大字符串内容长度配额 (8192)。
通过更改在创建 XML 读取器时所使用的 XmlDictionaryReaderQuotas 对象的
解决方法:在webconfig配置文件里添加
readerQuotas 节点(属性值的大小可根据自己的业务来定)
<binding name="Basicbindings" maxReceivedMessageSize="202400000">
<readerQuotas maxDepth="64" maxStringContentLength="524288"
maxArrayLength="32768" maxBytesPerRead="8192" maxNameTableCharCount="32768" />
</binding>
摘录msdn文档:
https://msdn.microsoft.com/zh-cn/library/ms731325.aspx