我有一个简单的网络服务,它有两个参数,一个是简单的 xml 安全 token ,另一个通常是一个长 xml 字符串。它适用于短字符串,但较长的字符串会给出 400 错误消息。 maxMessageLength 没有做任何事情来允许更长的字符串。
最佳答案
在回答配额问题后,我就在 web.config 中做了所有的事情
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IPayroll" maxReceivedMessageSize="6553600">
<security mode="None"/>
<readerQuotas maxDepth="32"
maxStringContentLength="6553600"
maxArrayLength="16384"
maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
</binding>
</wsHttpBinding>
</bindings>
关于WCF - 如何接受长字符串作为参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/135745/