2010-05-04 69 views
2

我遇到了一些麻煩,試圖讓我的WCF服務處理更大的字符串。我不斷收到以下錯誤。Xml閱讀器創建問題

The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader

App.config看起來像這樣

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 

    <system.web> 
    <compilation debug="true" /> 
    </system.web> 
    <!-- When deploying the service library project, the content of the config file must be added to the host's 
    app.config file. System.Configuration does not support config files for libraries. --> 
    <system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="wsHttpBindingSettings" maxReceivedMessageSize="2147483647"> 
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" 
      maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    <services> 
     <service name="WCFLongString.Service1" > 
     <endpoint address="" binding="wsHttpBinding" contract="WCFLongString.IService1" bindingConfiguration="wsHttpBindingSettings"> 
      <identity> 
      <dns value="localhost" /> 
      </identity> 
     </endpoint> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://localhost:8732/Design_Time_Addresses/WCFLongString/Service1/" /> 
      </baseAddresses> 
     </host> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <!-- To avoid disclosing metadata information, 
      set the value below to false and remove the metadata endpoint above before deployment --> 
      <serviceMetadata httpGetEnabled="True"/> 
      <!-- To receive exception details in faults for debugging purposes, 
      set the value below to true. Set to false before deployment 
      to avoid disclosing exception information --> 
      <serviceDebug includeExceptionDetailInFaults="False" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 

</configuration> 

我在這裏失去了一些東西?

+1

這是在客戶端還是服務器上配置的? – bzlm 2010-05-04 06:39:55

+0

還沒有到客戶端。我只是在VS中使用WCF配置工具進行測試 – 2010-05-04 06:54:29

回答

0

這可能是因爲您正在使用測試工具。嘗試爲服務創建一個簡單的使用者,並查看問題是否存在。如果它確實在客戶端上設置了與上述服務相同的配置。