Solved

WCF maxStringContentLength Web.Config Overflow

Posted on 2013-01-10
8
704 Views
Last Modified: 2013-01-28
I have developed a C# WCF web service successfully.  For the most part, it works fine.  However, when the XML content being passed to my web server exceeds 8192 bytes, the call to the WCF fails.  I have found numerous solutions on the web about this issue, but for some reason, I can't seem to correctly apply the changes to my environment.  I don't believe it's a client issue as the client calling my web service is a PERL script.  I even used WCF Service Configuration Editor as was mentioned in one posting, all to no avail.  Thanks for your help.

Here is the relevant section from my WEB.CONFIG that lives in the virtual directory on the server:

<system.serviceModel>
	<services>
		<service name="TaxonomyWCF">
			<endpoint address="http://myserver/TaxonomyTest/Taxonomy.svc" binding="basicHttpBinding" bindingConfiguration="largebuffers"/>
		</service>
	</services>
	<client>
		<endpoint address="http://myserver/TaxonomyTest/Taxonomy.svc" binding="basicHttpBinding" bindingConfiguration="largebuffers" name="TaxonomyEndpoint" kind="" endpointConfiguration="" contract="TaxonomyWCF.ITaxonomy"/>
	</client>
	<bindings>
		<basicHttpBinding>
			<binding name="largebuffers" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:05:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="100000000" maxBufferPoolSize="100000000" maxReceivedMessageSize="100000000" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
				<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
				<security mode="TransportCredentialOnly">
					<transport clientCredentialType="Ntlm"/>
				</security>
			</binding>
		</basicHttpBinding>
	</bindings>
	<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="true"/>
			</behavior>
		</serviceBehaviors>
	</behaviors>
	<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
	<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

Open in new window


Here is the C# interface definition file:

namespace TaxonomyWCF
{
    [ServiceContract]
    public interface ITaxonomy
    {

        [OperationContract]
        UpdateIssueResponse UpdateIssue(cqissue CQIssue);

        [OperationContract]
        UpdateTSRResponse UpdateTSR(cqtsr CQTSR);

    }
}

Open in new window

0
Comment
Question by:dpbouchard
  • 4
  • 4
8 Comments
 
LVL 18

Expert Comment

by:DarrenD
ID: 38766367
0
 
LVL 1

Author Comment

by:dpbouchard
ID: 38766776
Darren, thanks for trying but I already have readerQuotas in my config file as shown above.
0
 
LVL 18

Expert Comment

by:DarrenD
ID: 38766789
Try bumping up the maxBufferSize="100000000" maxBufferPoolSize="100000000" maxReceivedMessageSize="100000000" to 2147483647

Just a thought...
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 1

Author Comment

by:dpbouchard
ID: 38766825
Darren,, the buffer I'm sending to the WCF is only 25,000 bytes long.  The issue, I'm sure, is that I've not connected the readerQuotas somehow to the actual service definition.  The error I am getting is still the maxContentStringLength > 8192.  Thanks again.  Do you have any WCF configurations with large buffers working?
0
 
LVL 18

Assisted Solution

by:DarrenD
DarrenD earned 100 total points
ID: 38766863
Yes,

Although, I've recently joined a Java house so I'm not using it anymore.

You may have to change transferMode="Streaming" in the binding....

   <basicHttpBinding>
        <binding name="ExampleBinding" transferMode="Streaming"/>
      </basicHttpBinding>
0
 
LVL 1

Accepted Solution

by:
dpbouchard earned 0 total points
ID: 38809669
ended up burning up a support case with microsoft, please close question
0
 
LVL 1

Author Closing Comment

by:dpbouchard
ID: 38826104
appreciate attempt to help.
0
 
LVL 18

Expert Comment

by:DarrenD
ID: 38826232
Hi,

Could you let us know what the solution was? It would be interesting to know.

Thanks,

Darren
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question