The maximum string content length quota (8192)


P

Peter

I have web application which calls WFC service, but I am getting the
following error:



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. Line 243, position 38.



I have see a lot of references to this error but none of the solution seem
to help, the solutions say to update your client config, but don't say what
is the client config file, is it the web.config ?

I have created a the web.config file for the WFC service and here are the
contents, but it still does not work, also I have also updated the
maxStringContentLength in the web.config file for the web application.

Does anybody have solution to this problem?

Here's the WFC service web.config file:

<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="DebugFlag" value="False" />
<add key="RequestDirectory" value="Requests" />
<add key="ReportServicePort" value="8000" />
<add key="ReportsServiceUri"
value="tcp://reports01:8000/ReportsServer.tcp" />
<add key="ReportsServiceUriLocal"
value="tcp://devcon3:8000/ReportsServer.tcp" />
</appSettings>

<system.serviceModel>
<services>
<service behaviorConfiguration="ServiceBehavior"
name="ReportServiceLibrary.ReportService">
<endpoint address="" binding="wsHttpBinding"
contract="ReportServiceLibrary.IReportService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange" />
<endpoint address="basic" binding="basicHttpBinding"
bindingConfiguration=""
contract="ReportServiceLibrary.IReportService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<!-- 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="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IReportService"
closeTimeout="08:01:00"
openTimeout="08:01:00" receiveTimeout="08:10:00"
sendTimeout="08:01:00"
allowCookies="false" bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288"
maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8"
transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="16384"
maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None"
proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName"
algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="WSHttpBinding_IReportService"
closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00"
sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8"
useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="16384"
maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows"
proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows"
negotiateServiceCredential="true"
algorithmSuite="Default"
establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint
address="http://reports01.vanhoof.com/ReportServiceLibrary/ReportService.svc"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IReportService"
contract="IReportService"
name="WSHttpBinding_IReportService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint
address="http://reports01.vanhoof.com/ReportServiceLibrary/ReportService.svc/basic"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IReportService"
contract="IReportService"
name="BasicHttpBinding_IReportService" />
</client>
</system.serviceModel>
</configuration>



Thank you

Peter
 
Ad

Advertisements

S

sloan

Does it happen on the Server(service) side or does the server work, but the
communication over the "wire" fail?

I would start here:
maxReceivedMessageSize="65536"

But if its something on the serverside, then pumping up the config values
won't help.
 
S

sloan

I would wire this up:
(This would be in the config file of your HOST.

<system.diagnostics>

<trace autoflush="true" />

<sources>

<source name="System.ServiceModel"

switchValue="Information, ActivityTracing"

<listeners>

<add name="sdt"

type="System.Diagnostics.XmlWriterTraceListener"

initializeData= "c:\wutemp\Host1.svclog" />

</listeners>

</source>

</sources>

</system.diagnostics>



(Please note the directory C:\wutemp\ has to exist.......(or whatever
directory you pick)



Then use the tool

SvcTraceViewer.exe

to look at the file

Note, on my machine, the location of the file is:

"C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\SvcTraceViewer.exe"





Likewise, you can setup the trace tool on the client side as well:


<system.diagnostics>

<trace autoflush="true" />

<sources>

<source name="System.ServiceModel"

switchValue="Information, ActivityTracing"

<listeners>

<add name="sdt"

type="System.Diagnostics.XmlWriterTraceListener"

initializeData= "c:\wutemp\Client1.svclog" />

</listeners>

</source>

</sources>

</system.diagnostics>
 
P

Peter

Thank you for your help, the error is comming from the Host, but the error
message is the same as what I get in my application

The formatter threw an exception while trying to deserialize the message:
Error in deserializing body of request message for operation
'GetReportFileName'. 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. Line 243, position 38.

So where do I change this MaxStringContentLength, I've already changed it
in web.config and app.config but I am still getthing the error?
 
A

Allen Chen [MSFT]

Hi Peter,
I have web application which calls WFC service, but I am getting the
following error:
...

It looks like the basicHttpBinding config is not applied to the endpoint.
Could you try the following config to see if it works? In your original
post we can see bindingConfiguration="" so the basicHttpBinding you defined
takes no effect on the endpoint.

<endpoint address="basic" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IReportService"
contract="ReportServiceLibrary.IReportService" />

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Ad

Advertisements

P

Peter

Thank you

That fixed the problem


Allen Chen said:
Hi Peter,


It looks like the basicHttpBinding config is not applied to the endpoint.
Could you try the following config to see if it works? In your original
post we can see bindingConfiguration="" so the basicHttpBinding you
defined
takes no effect on the endpoint.

<endpoint address="basic" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IReportService"
contract="ReportServiceLibrary.IReportService" />

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support
Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top