.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

MaxReceivedMessageSize and maxStringContentLength

Posted By:      Posted Date: October 16, 2010    Points: 0   Category :WCF
 

Hi all,

I was wondering how the following two properties are related to eachother:

  • MaxReceivedMessageSize
  • maxStringContentLength

The MaxReceivedMessageSize Gets or sets the maximum size for a message that can be received on a channel configured with this binding. So this settings is representing how big the message could be in bytes, based on the current binding.

The maxStringContentLength is a positive integer that specifies the maximum characters allowed in XML element content. The default is 8192.

Raising the MaxReceivedMessageSize without raising the maxStringContentLength could give you some problems, right? When do you want to raise only the maxreceivedmessagesize without raising the maxStringContentLength?

Thanks in advance!

Regards,

Dennis

 




View Complete Post


More Related Resource Links

maxReceivedmessageSize exception is not logged.

  
HI all,   we have wcf service deployed to production, and we have implemented the interface IErrorHandler to log events into eventvwr when ever an exception is raised in a service method, all is well and its working fine, but all of a sudden we are getting that method "xyz has failed, so i went into the event log to see that exception "nothing was logged" so out of curisoity i turned on tracing and i see the error  that the maxreceived message size has excedded, so i changed the config and everything is working as expected. Note: We use IIS to host this service the issue: why dint wcf log this message and what changes do i need to make so that these kind of errors are logged somewhere your help is appreciated. Thanks -nen  

MaxStringContentLength Issue with WCF/Silverlight communications

  
We are having what appears to be a fairly common issue in that we are not able to send requests to our IIS based WCF service that exceed the 8192 MaxStringContentLength default.  I have been through a vast number of posts relating to this issue and have verified and/or addressed the issues of setting the length to a higher number and making sure that our endpoint has a bindingConfiguration that points to the correct binding. I have been looking at this on and off for a number of days and have not made any progress.  If anyone has any suggestions about how to correct the issue it would be massively appreciated.  The following is the pertinent information concerning our configuration and call structure: web.config <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="MyServiceBehavior"> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors> <bindings> <customBinding> <binding name="MyServiceBinding"> <binaryMessageEncoding maxReadPoolSize="2147483647" maxWritePoolSize="2147483647" maxSessionSize="2147483647"> <readerQuotas maxDepth="2147483647" maxStringContentLength=&qu

solution for maxstringcontentlength in wcf service?

  
I have the same problem. Everywhere just tells me to change my MaxStringContentLength property. I changed it in the bindings, but it still seems to address 8192. Do I need to change something else?   <binding name="UIFEndpoint" closeTimeout="10:01:00" openTimeout="10:01:00" receiveTimeout="10:10:00" sendTimeout="10:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">                     <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>                     <reliableSession ordered="true" inactivityTimeout="10:10:00" enabled="false"/>                     <security mode="Message">  &n

solution fro maxstringcontentlength in wcf server?

  
I have the same problem. Everywhere just tells me to change my MaxStringContentLength property. I changed it in the bindings, but it still seems to address 8192. Do I need to change something else?   <binding name="UIFEndpoint" closeTimeout="10:01:00" openTimeout="10:01:00" receiveTimeout="10:10:00" sendTimeout="10:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">                     <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>                     <reliableSession ordered="true" inactivityTimeout="10:10:00" enabled="false"/>                     <security mode="Message">  &n

Compact Framework - MaxReceivedMessageSize property

  

I am using Microsoft Synchronization services to synchronize a SQL Server Compact Edition database with a SQL Server 2008 database. I used the netcfSvcUtil.exe tool to generate the wcf service the mobile client will use to connect to the server.

The client uses a basicHttpBinding, which is required for WCT on the compact framework. The synchronization works fine for small amounts of data. When I try to synchronize larger amounts of data I receive an exception with the following message on the client:

"The maximum message size quota for incoming messages(65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding."

It took a while but I figured out how and where to change this on the client. In MyServiceClientContract I change the binding as it is created:


   Public Shared Function CreateDefaultBinding() As
System.ServiceModel.Channels.Binding
       Dim binding As System.ServiceModel.Channels.CustomBinding =
New System.ServiceModel.Channels.CustomBinding
       binding.Elements.Add(New
System.ServiceModel.Channels.TextMessageEncodingBindingElement(System.ServiceModel.Channels.MessageVersion.Soap11,
System.Text.Encoding.UTF8))
       'binding.E

problem with MaxReceivedMessageSize

  

Hi, I have a application set up that works for normal sized messages, but gives the following exception when trying to send a message

( after xml serialisation, the message appears to be 307KB)

---> System.ServiceModel.QuotaExceededException: The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

As far as i can see, all my size settings in de web.config ( serverside) and appconfig ( client side ) are maxed out.

the error only occurs when sending the 307KB message from client to server, when retrieving the exact message (from a get operation : server to client), then no error occurs, so i assume the app.config file is correct.

web.config

 <system.serviceModel>
  <serviceHostingEnvironment multipleSiteBindingsEnabled="true" 

WCF Service hosted inside SharePoint 2010's ISAPI folder and MaxReceivedMessageSize

  

I got a WCF service hosted inside the SharePoint 2010 following this article http://answers.oreilly.com/topic/1404-how-to-customize-wcf-services-in-sharepoint-2010/

Everything was going great until I wanted to increase the MaxReceivedMessageSize however there is no configuration file for this service.

I tried to add a configuration file to be deployed along with the svc service in the same directory inside the ISAPI mapped folder but I get this error:

The service '/_vti_bin/epcc/messagesarchive/contactssearcher.svc' cannot be activated due to an exception during compilation.  The exception message is: Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are []..

Here is my configuration,

<configuration>
 <system.serviceModel>
  <services>
   <service name="WCFServices.ContactsSearcher.ContactsSearcher" behaviorConfiguration="ContactsSearcherBehavior">
    <endpoint address="ContactsSearcher"
         binding="basicHttpBinding"
         bindingConfiguration="ContactsSearcherBinding"
         contract="WCFServices.ContactsSearcher.IContactsSearcher"></endpoint>
    <endpoint address="mex"
         binding="mexHttpBindin

MaxStringContentLength property on the XmlDictionaryReaderQuotas object

  

Hello All,

I am getting below error, any idea why this error come?

The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/IMainService:BusinessObj. The InnerException message was 'There was an error deserializing the object of type System.String. 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 226, position 30.'.  Please see InnerException for more details.


how do i set maxReceivedMessageSize

  

How do i set maxReceivedMessageSize property in app.config file. Here is my config file. What am i doing wrong here???

<system.serviceModel>
  <bindings>
   <basicHttpBinding>
    <binding name="myBinding" maxReceivedMessageSize="400000"/>
   </basicHttpBinding>
  </bindings>
  <

WCF Test Client - increasing MaxReceivedMessageSize

  

Hi, 

I am using the WCF Test Client that ships with Visual Studio 2010 to test my WCF service.  However, i am getting the error" The maximum message size quota for incoming messages (65536) has been exceeded" after using the WCF Test Client utility to invoke a method on my service.

I know how to configure a service to increase MaxReceivedMessageSize by configuring a binding configuration, but how can i increase the MaxReceivedMessageSize of the WCF Test Client itself that ships with VS2010?

Thanks for any help


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend