Solved

WCF maxStringContentLength Web.Config Overflow

Posted on 2013-01-10
8
695 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
 
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now