I have created a WCF service which receives String (Text/Json) as a request, but the problem is it is only able to receive String length of 65536 (String.Length). I have tried below (binding maxReceivedMessageSize="2147483647") by googling but there is no change it is only able to receive 65536 of String.Length size only not more that. I am newbee to the dotNet and WCF word, can someone help me to send large data to this service (I wanted to send around 10MB of data to my WCF service).
My Server Config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service name="[my-service-name]">
<endpoint address="http://localhost:8005/MyService"
binding="webHttpBinding"
contract="[my-service-contract-name]"/>
</service>
</services>
<bindings>
<basicHttpBinding>
<binding maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647">
<readerQuotas maxDepth="32"
maxArrayLength="2147483647"
maxStringContentLength="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
My Service:
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "MyService")]
void MyService(String input)
{
Console.WriteLine("Request data = " + input.Length);
}
Client Config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="name-here" maxReceivedMessageSize="2147483647">
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="behavior-here">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>