我正在尝试调用读取 XML 字符串的 WCF 服务。我收到此错误“Formater error the maximum string content length quota (8192) has been exceeded while reading XML data.” 下面是服务 web.config 文件
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IOrderCreateService"
maxReceivedMessageSize="2147483647"
openTimeout="00:1:00"
closeTimeout="00:1:00"
sendTimeout="00:25:00"
receiveTimeout="00:25:00">
</binding>
<binding name="HandleLargeMessage" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<services>
<!-- beta.telagententerprise.com/WcfServices-->
<service name="OrderCreateService.OrderCreateService">
<endpoint name="MessageServiceEndpoint"
address="http://localhost:2966/OrderCreateService.svc"
binding="basicHttpBinding"
bindingConfiguration="HandleLargeMessage"
contract="IOrderCreateService" />
</service>
</services>
</system.serviceModel>
下面是客户端app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IOrderCreateService"
maxReceivedMessageSize="2147483647"
openTimeout="00:1:00"
closeTimeout="00:1:00"
sendTimeout="00:25:00"
receiveTimeout="00:25:00">
</binding>
<binding name="HandleLargeMessage" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint name="MessageServiceEndpoint"
address="http://localhost:2966/OrderCreateService.svc"
binding="basicHttpBinding"
bindingConfiguration="HandleLargeMessage"
contract="OrderCreateService.IOrderCreateService" />
</client>
</system.serviceModel>
我搜索了这个错误尝试了上面的代码仍然得到 8192 错误。任何帮助都会很棒。谢谢,