WCF - 如何接受长字符串作为参数

标签 wcf web-services

我有一个简单的网络服务,它有两个参数,一个是简单的 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/

相关文章:

.net - 一键更新所有 WCF 服务引用(点击两次也可以!)

C# Web服务,如何接收JSON

web-services - Sharepoint Web 服务教程

android - 应用程序崩溃 - Web 服务没有返回

在 Eclipse 中生成 WSDL 时出现 Java ClassCastException?

azure - 使用 Azure 中托管的 Web 服务时发生错误

c# - 如何对 WCF ServiceHost.Faulted 事件进行单元测试

.net - PostgreSQL 服务停止工作

.net - 使用 WCF 创建 Web API

javascript - 将 javascript 映射传递给 json wcf 服务