Note that there are some explanatory texts on larger screens.

plurals
  1. POLarge string argument in WCF operation call
    primarykey
    data
    text
    <p>I am unable to pass a string as an argument to a WCF operation call. The string is quite large (about 12000 characters). </p> <p>I have increased maxStringContentLength in web.config and played around with almost all the attributes but the problem still remains.</p> <p>I have found a workaround - Split the string at client's end and concatenate at the server's end. It works this way.</p> <p>Can anybody direct me towards the right way of solving this problem? Why WCF operation call is able to accept the same amount of data (split into 2 string parameters) but throws error when that data is passed in one string parameter? Where do we configure the size limit of WCF operation arguments?</p> <p>---------------------------------CODE--------------------------------</p> <pre><code>TestService.Service1Client client = new TestService.Service1Client(); string str = "VERY LARGE STRING"; //DOES NOT WORK client.TakeLargeStringParam(str); //WORKS client.TakeLargeStringParam2(str.Substring(0, 5000), str.Substring(5000)); </code></pre> <p>-----------------------WEB.CONFIG--------------------------</p> <pre><code>&lt;system.serviceModel&gt; &lt;bindings&gt; &lt;basicHttpBinding&gt; &lt;binding name="BasicHttpBinding_IService1" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"&gt; &lt;readerQuotas maxDepth="32" maxStringContentLength="819200" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt; &lt;security mode="None"&gt; &lt;transport clientCredentialType="None" proxyCredentialType="None" realm="" /&gt; &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/basicHttpBinding&gt; &lt;/bindings&gt; &lt;client&gt; &lt;endpoint address="http://localhost:30701/Service1.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1" contract="TestService.IService1" name="BasicHttpBinding_IService1" /&gt; &lt;/client&gt; &lt;/system.serviceModel&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload