WCF:The maximum string content length quota (8192) has been exceeded while reading XML data

修改接收端的WCF config文件,注意,如果server端接收request超长,则修改server端config,如果是client 接收response超长,则修改client端,建议两边都修改,保持一致

<bindings>
      <wsHttpBinding>
        <binding name="NewBinding2" maxReceivedMessageSize="67108864">
      <readerQuotas maxStringContentLength="67108864"/>
          <security mode="None" />
        </binding>
      </wsHttpBinding>
    </bindings>

 

<service behaviorConfiguration="DomainWS.DomainServiceV2Behavior"
      name="DomainWS.DomainServiceV2">
       <endpoint address="" binding="wsHttpBinding" bindingConfiguration="NewBinding2" contract="DomainWS.IDomainV2">
         <identity>
           <dns value="localhost" />
         </identity>
       </endpoint>
       <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
     </service>
   </services>

 

Note:

MaxStringContentLength

The maximum string length returned by the reader. The default is 8192.

posted @ 2009-01-20 07:54  upzone  阅读(3018)  评论(2编辑  收藏  举报