# Silverlight WCF call is too large for sharepoint wcf

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

<bindings>
<basicHttpBinding>
<binding name="MyDemoBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="MyDemoBehavior">
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="MyDemoBehavior" name="BEIM.Webservices.Service">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<host>
</host>
</service>
</services>

-

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.

HTH

-
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 –  Amjid Qureshi Jul 19 '11 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) –  Amjid Qureshi Jul 19 '11 at 8:25

got the answer from here and here

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

SPWcfServiceSettings wcfServiceSettings = new SPWcfServiceSettings();