格式化程序在尝试反序列化消息时抛出异常 [英] The formatter threw an exception while trying to deserialize the message

查看:431
本文介绍了格式化程序在尝试反序列化消息时抛出异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在调用方法时收到以下错误。

Senario如下wcf webservice viz(A)和wcf webservice viz(B)

webservice A是由Webservice b调用,而后者又由c#应用程序调用。



格式化程序在尝试反序列化消息时抛出异常:反序列化请求消息体的操作出错邮报。读取XML数据时已超出最大字符串内容长度配额(8192)。通过更改创建XML阅读器时使用的XmlDictionaryReaderQuotas对象的MaxStringContentLength属性,可以增加此配额。第1行,第10214位。



这是我对客户c#应用程序的绑定

I received the following error while calling a method .
The senario is as follows wcf webservice viz(A) and wcf webservice viz(B)
webservice A is called by Webservice b which in turn is called by c# application.

The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'Post'. The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 10214.

this is my binding of client c# application

<bindings>
<basicHttpBinding>
<binding name="LongFields" closeTimeout="00:01:00"

 openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"

 allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"

 maxBufferSize="2147483647" maxBufferPoolSize="21474836473" maxReceivedMessageSize="2147483647"

 messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"

 useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"

 maxBytesPerRead="40967" maxNameTableCharCount="2147483647" />
 <security mode="None">
 <transport clientCredentialType="None" proxyCredentialType="None"

  realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>


<endpoint address=""

 binding="basicHttpBinding" bindingConfiguration="LongFields"

 contract="V.IService" name="LongFields" />





这是我的网络服务配置



and this is my webservice config

<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService" closeTimeout="00:01:00"

 openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"

 allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"

 maxBufferSize="2147483647" maxBufferPoolSize="21474836473" maxReceivedMessageSize="2147483647"

 messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"

 useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"

 maxBytesPerRead="40967" maxNameTableCharCount="2147483647" />
 <security mode="None">
 <transport clientCredentialType="None" proxyCredentialType="None"

 realm="" />
 <message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>


 <endpoint address=""

    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"

    contract="V.IService" name="BasicHttpBinding_IService" />

推荐答案

看看这里 [ ^ ]

看起来像他们有一个问题的解决方案。
Take a look here[^]
It looks like they have a solution to your problem.


ExcelledProducts CEO感谢链接

但它解决了我的问题,错误仍然存​​在

i在webservice的web.config文件中输入以下标记

ExcelledProducts CEO thanks for link
but it dint solve my problem the error is still present
i entered the following tag in web.config file of the webservice
<system.web>
     <httpruntime maxrequestlength="2097151" />

  </system.web>


这篇关于格式化程序在尝试反序列化消息时抛出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆