I created a simple WCF rest endpoint and deployed it to Sharepoint - 80 running under IIS.
The service accepts a post request with JSON content. It works fine when the post request's content does not exceed 65536 bytes. For any larger posts the server responds with a
413 request entity too large
64k seems to be the default upload limit in IIS. To increase the limit, I want to add a web.config
and set the maxReceivedMessageSize
parameter.
However, when I add the following web.config
into the home directory of the service:
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding name="ExtendedMaxSize"
maxBufferSize="999999" maxReceivedMessageSize="999999" />
</webHttpBinding>
</bindings>
<services>
<service name="SharePointProject1.Service1" behaviorConfiguration="">
<endpoint address="http://localhost/_vti_Bin/testproject/sharepointproject1.svc"
binding="webHttpBinding"
bindingConfiguration="ExtendedMaxSize"
contract="SharePointProject1.IService1" />
</service>
</services>
</system.serviceModel>
</configuration>
the service stops running and throws the error
A registration already exists for http://localhost/_vti_Bin/testproject/sharepointproject1.svc
How can I change the service configuration to increase the upload limit?
PS: I have researched SO extensively and found numerous links all pointing to changing the settings in web.config
. I tried changing the standard Sharepoint web.config
which did not have any effect on my service.