Solved

WCF maxStringContentLength Web.Config Overflow

Posted on 2013-01-10
8
706 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
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 …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

830 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