I have a silverlight 4 project calling a WCF service deployed on sharepoint 2010.

There are two methods a get and and a save,

teh get works fine but the save returns a generic message "Not Found"

The save is passing a large object with 2 lists. If I reduce the size of the list it all works.

So I figure I have to increase the maxReceivedMessageSize, this is easily done on the silverlight side just edit ServiceReferences.ClientConfig.

however I dont know where to do it on teh server side

Where is the binding information on the shaprepoint webserver. I've had a look in \inetpub\wwwroot\wss\VirtualDirectories\80\web.config and it isn't there.

is there an easy way to get the binding info from teh URL?

I tried to setup some bindings for it but I just get errors my attempt is

         <binding name="MyDemoBinding">  
             <security mode="TransportCredentialOnly">  
                 <transport clientCredentialType="Ntlm" />  
         <behavior name="MyDemoBehavior">  
             <serviceMetadata httpGetEnabled="true" />  
             <serviceDebug includeExceptionDetailInFaults="false" />  
     <service behaviorConfiguration="MyDemoBehavior" name="BEIM.Webservices.Service">  
         <endpoint address="" binding="basicHttpBinding" bindingConfiguration="MyDemoBinding" contract="BEIM.Webservices.IService">  
             <dns value="localhost" />  
             <add baseAddress=”http://localhost/_vti_bin/BEIM.Webservices” />  

2 Answers 2


I haven't done this myself but a search of MSDN turned up a few things.

This link indicates under the heading WCF Dynamic Configuration that you don't use web.config to register a WCF. Rather you need to use the SharePoint Foundation service factory. Following the links, I found this, this and this which looks like what you want: SPWcfService has a member called MaxReceivedMessageSize which looks suspiciously like what you need.


  • So I get that you can loop through them and hopefully change teh maxReceivedMessageSize. But when do you do this?? Am a bit new to Sharepoint cheers @mike Jul 19, 2011 at 6:04
  • You put me on the right track, the answer was here link But you have to make suer the service name is lower case (very important) Jul 19, 2011 at 8:25

got the answer from here and here

private void ConfigureWebService()
SPWebService contentService = SPWebService.ContentService;

SPWcfServiceSettings wcfServiceSettings = new SPWcfServiceSettings();
wcfServiceSettings.ReaderQuotasMaxStringContentLength = 10485760;
wcfServiceSettings.ReaderQuotasMaxArrayLength = 2097152;
wcfServiceSettings.ReaderQuotasMaxBytesPerRead = 10485760;
wcfServiceSettings.MaxReceivedMessageSize = 10485760; 
// must be in lower case
contentService.WcfServiceSettings["myservice.svc"] = wcfServiceSettings;


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.