简体   繁体   English

WCF-读取XML数据时超出了最大字符串内容长度配额(8192)

[英]WCF - The maximum string content length quota (8192) has been exceeded while reading XML data

I have a web service that is used by third parties to access various bits of functionality for the company I work for. 我有一个Web服务,第三方可以使用该服务访问我所工作的公司的各种功能。 This web service is using another web service within the company to send email, and this is the error we're receiving on particularly long emails - "The maximum string content length quota (8192) has been exceeded while reading XML data." 该Web服务正在使用公司内的另一个Web服务发送电子邮件,这是我们在特别长的电子邮件中收到的错误-“读取XML数据时,已超出最大字符串内容长度配额(8192)。”

I've already read through the question and answers here , but with no luck. 我已经在这里阅读了问题和答案,但是没有运气。 I've modified the readerQuotas on the basicHttpBinding element of my web.config file, and I'm still receiving this error. 我已经在web.config文件的basicHttpBinding元素上修改了readerQuotas,但仍然收到此错误。 Modifying the server's (where the web service I'm calling resides) is a no-go, since this issue isn't happening with any other clients using the service, and this is in an enterprise environment. 修改服务器(我正在调用的Web服务所驻留的位置)是不行的,因为使用该服务的任何其他客户端都不会发生此问题。 I'm able to call this service outside of my own service, using the exact same content, with success. 我可以使用完全相同的内容在自己的服务之外调用此服务,并获得成功。 It's just when I'm calling my service which calls the email service that the error appears. 只是在我调用服务的同时调用电子邮件服务时,才会出现错误。

Does anyone have any suggestions at all? 有人有什么建议吗? I'm at a standstill, and am tired of bashing my head against this. 我处于停滞状态,厌倦了对此ash之以鼻。 My only thought right now is to modify the config file for the email service, but there's only one within the company and it's a production service, so that's nigh impossible just to test and see if this resolves my issue. 我现在唯一的想法就是修改电子邮件服务的配置文件,但是公司内部只有一个文件,这是一个生产服务,因此几乎无法测试并查看是否可以解决我的问题。

Thanks, 谢谢,

TJ TJ

Edit: Relevant config sections 编辑:相关配置部分

Client 客户

<endpoint address="https://foo.domain/MailService.asmx"
    binding="basicHttpBinding" bindingConfiguration="MailServiceSoap"
    contract="MailService.MailServiceSoap" name="MailServiceSoap" />

<basicHttpBinding>      
    <binding name="MailServiceSoap"  maxReceivedMessageSize="2147483647"
        maxBufferSize="2147483647" openTimeout="00:10:00" receiveTimeout="00:10:00"
        sendTimeout="00:10:00" closeTimeout="00:10:00">
    <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
        maxArrayLength="2147483647" maxBytesPerRead="2147483647"
        maxNameTableCharCount="2147483647" />
    <security mode="Transport">
        <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
        <message clientCredentialType="UserName" algorithmSuite="Default"/>
    </security>
    </binding>
</basicHttpBinding>

Server 服务器

Working on this still. 仍在努力。 I don't have any access to it. 我没有访问权限。

Is it possible you might be overwriting your config settings programmatically, or have you tried setting them programmatically? 您是否有可能以编程方式覆盖配置设置,还是尝试以编程方式设置配置设置? Just a thought. 只是一个想法。

I found my solution, and it was here . 我找到了解决方案,就在这里 I got so caught up in the thinking that it was between my service and the service I was calling, when it was actually completely separate. 我非常想起它是在我的服务和我正在调用的服务之间,而实际上却是完全分开的。 My service wasn't set up to handle messages that long. 我的服务没有设置来处理消息那么长时间。 The top answer in the linked post had the information that clued me in - namely, the server deserializes data, while the client reads data. 链接文章中最重要的答案是让我了解的信息-即服务器反序列化数据,而客户端读取数据。 My error was around deserializing the data, meaning my server was the issue. 我的错误是关于反序列化数据的问题,这意味着我的服务器是问题所在。 I extended the length of the readerQuotas in the binding element for my service, and problem was solved. 我在服务的绑定元素中增加了readerQuotas的长度,从而解决了问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将 XML 字符串发送到 WCF 时出现“读取 XML 数据时已超出最大字符串内容长度配额 (8192)”错误 - "The maximum string content length quota (8192) has been exceeded while reading XML data" error while sending XML string to WCF “在读取XML数据时已超出最大字符串内容长度配额(8192)”将XML字符串发送到WCF时出错 - “The maximum string content length quota (8192) has been exceeded while reading XML data” error while sending XML string to WCF 反序列化类型的对象时发生错误...读取XML数据时超出了最大字符串内容长度配额(8192) - There was an error deserializing the object of type … The maximum string content length quota (8192) has been exceeded while reading XML data WCF Config修复最大字符串内容长度配额(8192) - WCF Config to fix The maximum string content length quota (8192) has been exceeded WCF:读取XML数据时已超出最大数组长度配额(16384) - WCF: The maximum array length quota (16384) has been exceeded while reading XML data 已超过最大字符串内容长度配额(8192)。增加XmlDictionaryReaderQuotas的MaxStringContentLength属性 - The maximum string content length quota (8192) has been exceeded.Increase the MaxStringContentLength property on the XmlDictionaryReaderQuotas WCF - 读取XML数据时已超出最大名称表字符计数配额(16384) - WCF - The maximum nametable character count quota (16384) has been exceeded while reading XML data ServiceStack:读取XML数据时已超出最大数组长度配额(16384) - ServiceStack: The maximum array length quota (16384) has been exceeded while reading XML data WCF阅读器配额最大字符串内容长度配额(8192) - WCF reader quota The maximum string content length quota (8192) 使用Delphi使用WCF - 最大字符串内容长度配额(8192)错误 - Consuming WCF with Delphi - Maximum string content length quota (8192) error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM