Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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">  
             <serviceMetadata httpGetEnabled="true" />  
             <serviceDebug includeExceptionDetailInFaults="false" />  
         </behavior>  
     </serviceBehaviors>  
 </behaviors>  
 <services>  
     <service behaviorConfiguration="MyDemoBehavior" name="BEIM.Webservices.Service">  
         <endpoint address="" binding="basicHttpBinding" bindingConfiguration="MyDemoBinding" contract="BEIM.Webservices.IService">  
         <identity>  
             <dns value="localhost" />  
         </identity>  
     </endpoint>  
     <host>  
         <baseAddresses>  
             <add baseAddress=”http://localhost/_vti_bin/BEIM.Webservices” />  
        </baseAddresses>  
     </host>  
     </service>  
 </services> 
share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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

share|improve this answer
    
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
add comment

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;

contentService.Update();
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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