SharePoint In Action

An attempt to share my day-to-day SharePoint experience

Archive for the category “WCF”

Error: The Method “GetItems” of the type “List” with id “{Lists’s Guid}” is blocked by the administrator on the server

Hi all,

I was using SharePoint Client Object Model when I got the error above. Basically I was trying to get all items from a list using JavaScript’s get_lists function. It seems the function is inaccessible in anonymous mode. The solution is removing the function GetItems from AnonymousRestrictedTypes using PowerShell:

$web = Get-SPWebApplication -Identity http://your web address
$web.ClientCallableSettings.AnonymousRestrictedTypes.Remove( [Microsoft.SharePoint.SPList],"GetItems")
$web.Update()

and in case you change your mind later, you can addf GetItems to AnonymousRestrictedTypes using commands below:

$web = Get-SPWebApplication -Identity http://your web address
$web.ClientCallableSettings.AnonymousRestrictedTypes.Add( [Microsoft.SharePoint.SPList],"GetItems")
$web.Update()

Hope that was useful!

Cheers,
Nader Heshmat

Advertisements

error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding

Hi,

I just got an error in my client application that uses a wcf method to extract some data from a SQL Server database. The error was:

“Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding”

Obviously it’s a timeout issue due to complexity of the query. To fix this you would need to take alook at your binding settings in the App.config file. Typically there are a few timeout settings that you can modify there. Look under section and locate and then . You should see the settings for your timeouts like below:

<system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="your service interface name" closeTimeout="00:18:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:18:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    .
                    .
                    .
                    .
                </binding>
             </basicHttpBinding>
         </bindings>
</system.serviceModel>

The sendTimeout shows how long the client will wait till it gets the response from WCF service. The format is hours:minutes:seconds. It shows the total time of sending a message through your service including receiving the reply message in a wcf request-reply case.
The closeTimeout shows how long you will wait before you close the connection before an exception is thrown. Usually this disposes the client WCF proxy.

In my case, I just increased the sendTimeout and closeTimeout and the problem was gone.

Cheers,
Nader Heshmat

Post Navigation