The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased...
-
Tesic Goran wrote:
tried to increase the value of MaxStringContentLength parameter in app.config file on client side
What about the server side - did you set it there too??
Mark Salsbery Microsoft MVP - Visual C++ :java:
Where and how should I set it on server side? I only have that automatically generated Web.config file.
-
Where and how should I set it on server side? I only have that automatically generated Web.config file.
Who is creating the BasicHttpBinding on the server?? Note I'm not sure that is the fix (especially since reader quotas apply to the client anyway) - I was just asking if you tried. There's a claim on this thread[^] that setting it on the server worked...
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Who is creating the BasicHttpBinding on the server?? Note I'm not sure that is the fix (especially since reader quotas apply to the client anyway) - I was just asking if you tried. There's a claim on this thread[^] that setting it on the server worked...
Mark Salsbery Microsoft MVP - Visual C++ :java:
VS2010 created all config files automatically. I haven't created anything manually. I'm not sure what I should change on server side. I mean what code I should write.
-
VS2010 created all config files automatically. I haven't created anything manually. I'm not sure what I should change on server side. I mean what code I should write.
Tesic Goran wrote:
VS2010 created all config files automatically
hmm how? I don't see any endpoint configuration in your posted web.config!
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Tesic Goran wrote:
VS2010 created all config files automatically
hmm how? I don't see any endpoint configuration in your posted web.config!
Mark Salsbery Microsoft MVP - Visual C++ :java:
That's true. And everything works fine on client side if encoded string is not too long. That's Microsoft's stuff.
-
That's true. And everything works fine on client side if encoded string is not too long. That's Microsoft's stuff.
There must be some auto-generated code somewhere in the server code creating the service endpoint(s)... :)
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
There must be some auto-generated code somewhere in the server code creating the service endpoint(s)... :)
Mark Salsbery Microsoft MVP - Visual C++ :java:
No. You can try it in VS2010.
-
No. You can try it in VS2010.
Ok....took a while to track down, but I found it documented. I've been using web.config files carried over from previous visual studio and .NET framework versions so I never noticed the configuration doesn't get added to the server web.config any more :) A Developer's Introduction to Windows Communication Foundation 4[^]...specifically the "Default Endpoints" section...
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Ok....took a while to track down, but I found it documented. I've been using web.config files carried over from previous visual studio and .NET framework versions so I never noticed the configuration doesn't get added to the server web.config any more :) A Developer's Introduction to Windows Communication Foundation 4[^]...specifically the "Default Endpoints" section...
Mark Salsbery Microsoft MVP - Visual C++ :java:
Thank you for the link, but there's nothing about how I should alter my Web.config file. I've tried several things, but it doesn't work. I really don't understand Microsoft. What's the purpose of this apporach? People should concentrate to infrastructure instead of coding. In my opinion it's wrong. How to alter Web.config file?
modified on Tuesday, May 31, 2011 11:48 PM
-
Hi, I have VS2010 solution that consists of 2 projects: 1) ASP.NET web application with WCF service. WCF service is hosted to ASP.NET Development Server. 2) Windows Forms client application that uses WCF service. WCF service is decoding some previously encoded string and converting it to XML. The length of encoded string differs. It can be very long. What's happining? When input encoded string is very long, this exception is thrown:
System.ServiceModel.ProtocolException was unhandled
Message=The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'Decode'. 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 1, position 17956.
Source=mscorlib
StackTrace:
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
...I've read some articles and forum posts on internet and tried to increase the value of MaxStringContentLength parameter in app.config file on client side, but it didnt't help. My app.config file on client side looks as follows:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IUfoDecoderService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredCould someone, please, help me about this? Thank you in advance.
-
Hi, I have VS2010 solution that consists of 2 projects: 1) ASP.NET web application with WCF service. WCF service is hosted to ASP.NET Development Server. 2) Windows Forms client application that uses WCF service. WCF service is decoding some previously encoded string and converting it to XML. The length of encoded string differs. It can be very long. What's happining? When input encoded string is very long, this exception is thrown:
System.ServiceModel.ProtocolException was unhandled
Message=The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'Decode'. 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 1, position 17956.
Source=mscorlib
StackTrace:
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
...I've read some articles and forum posts on internet and tried to increase the value of MaxStringContentLength parameter in app.config file on client side, but it didnt't help. My app.config file on client side looks as follows:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IUfoDecoderService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredYou need to have similar binding configuration in the web.config of your service as well. Your services configuration should look like this:
<services>
<service name="yourService">
<endpoint binding="yourBinding">
</endpoint>
</service>
</services>Endpoint should have other relevant details as well.
"The worst code you'll come across is code you wrote last year.", wizardzz[^]
-
You need to have similar binding configuration in the web.config of your service as well. Your services configuration should look like this:
<services>
<service name="yourService">
<endpoint binding="yourBinding">
</endpoint>
</service>
</services>Endpoint should have other relevant details as well.
"The worst code you'll come across is code you wrote last year.", wizardzz[^]
Thank you, but it doesn't help me. I've tried several things, but it's not working. Please, here's my app.config file on client side:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IUfoDecoderService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647"
maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost/UfoDecoderWebApplication/UfoDecoderService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IUfoDecoderService"
contract="ServiceReference.IUfoDecoderService" name="BasicHttpBinding_IUfoDecoderService" />
</client>
</system.serviceModel>
</configuration>My automatically generated (by VS2010) Web.config file looks as follows:
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
--><configuration>
<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
</connectionStrings><system.web>
<compilation debug="true" targetFramework="4.0" /><authentication mode="Forms"> <forms loginUrl="~/Account/Login.aspx" timeout="2880" /> </authentication>
-
Thank you, but it doesn't help me. I've tried several things, but it's not working. Please, here's my app.config file on client side:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IUfoDecoderService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647"
maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost/UfoDecoderWebApplication/UfoDecoderService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IUfoDecoderService"
contract="ServiceReference.IUfoDecoderService" name="BasicHttpBinding_IUfoDecoderService" />
</client>
</system.serviceModel>
</configuration>My automatically generated (by VS2010) Web.config file looks as follows:
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
--><configuration>
<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
</connectionStrings><system.web>
<compilation debug="true" targetFramework="4.0" /><authentication mode="Forms"> <forms loginUrl="~/Account/Login.aspx" timeout="2880" /> </authentication>
-
Could someone, please, help me about this? Thank you in advance.
I gave you a link that shows all kinds of info on customizing the configuration of the default endpoints. You said the link didn't have any info. I personally prefer to explicitly configure endpoints. I read this from the link: "Here's how it works. When the host application calls Open on the ServiceHost instance, it builds the internal service description from the application configuration file along with anything the host application may have configured explicitly and if the number of configured endpoints is still zero, it calls AddDefaultEndpoints, a new public method found on the ServiceHost class. This method adds one or more endpoints to the service description based on the service’s base addresses (in IIS scenarios, this is the .svc address). Since the method is public, you can also call it directly in custom hosting scenarios." So if you explicitly configure an endpoint it will use your configuration. There's all kinds of info on MSDN about configuring endpoints. Using web.config you can start with something like this in the system.serviceModel section (substitute your own service, namespace, and interface names):
<system.serviceModel>
<services> <service name="ASPNETWebApplicationTester.Service1" behaviorConfiguration="ASPNETWebApplicationTester.Service1Behavior" > <endpoint name="ASPNETWebApplicationTester.Service1Binding" address="" binding="basicHttpBinding" bindingConfiguration="ASPNETWebApplicationTester.Service1Binding" contract="ASPNETWebApplicationTester.IService1"> <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> <host> <!-- \*\* No base addresses allowed when hosting on IIS 7. Our service is at http://localhost/ASPNETWebApplicationTester/Service1.svc \*\* <baseAddresses> <add baseAddress="http://localhost:55008/Design\_Time\_Addresses/ASPNETWebApplicationTester/Service1/" /> </baseAddresses> --> </host> </service> </services> <behaviors> <serviceBehaviors> <behavior name="ASPNETWebApplicationTester.Service1Behavior"> <serviceMetadata httpGetEnabled="true" />