Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

WCF maxStringContentLength Web.Config Overflow

Posted on 2013-01-10
8
Medium Priority
?
723 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

705 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