Solved

WCF maxStringContentLength Web.Config Overflow

Posted on 2013-01-10
8
710 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
asp.net web application 3 58
ASP.NET - Why is accordion not working? 3 70
YouTube API get the Video Tags - vb.net 7 51
CSS question 16 63
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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