2010-05-04 43 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

这可能是因为您正在使用测试工具。尝试为服务创建一个简单的使用者,并查看问题是否存在。如果它确实在客户端上设置了与上述服务相同的配置。