Jun 14, 2011

SharePoint Web Service - Elevated Privilege / Anonymous Access / Performance

Considering SharePoint Web Service, watch out for the following:

* SharePoint internet site has anonymous user base. Calling web service from an anonymous internet sp site is not straight forward. Moreover, Read only web service call from anonymous SP pages is feasible.   The following blogs takes a stab on it:     

* Web Service work great when small amount of data across the network is considered. If web service requires intensive operations this in turn puts frequent database updates and cause a significant burden in a production environment. For example, using Web services to bulk load or synchronize a list with a database is risky, depending on the amount of data and the period of synchronization. A more acceptable use of code that accesses a Web service is for a Web Part to access a built-in service to query a set of items in a list. More

* Considering best practices; Microsoft does not recommend heavy use of SharePoint Web Services for updating SharePoint data, however, passive use of SharePoint Web Services to read service data is considered acceptable.
* At times we need to elevate privilege to perform certain action on the SP server via managed code. When working with the SharePoint Web Services you can't elevate the privilege.  More on this: 

* Some other notable blog points out:

-          Web Services use XML based SOAP (Simple Object Access Protocol) messages as the communication protocol
-          Reliance on XML can translate into high overhead in the form of oversized, sluggish messages
-          This can mean an investment in XML appliances or other software to optimize validation, parsing, and analysis of XML messages.
-          As Web services operate autonomously, with no centralized control, users may find them unpredictable, necessitating IT to provide service guarantees or service-level agreements.
-          Every request has a marshalling un-marshalling overhead.
-          Every request has to be authenticated using user name and password. It does not support the concept of authenticated session, which can be re-used with a session key. Exception is Excel Service Web Service
-          Issues with Downloading Files  Copy web service i.e. Marshalling/un-marshalling overhead: The SharePoint Server encodes the binary file data (e.g. Word, Excel file) into text (using Base64 encoding) in order to send it over Web Service. The client application should decode it back to the original encoding for viewing the file. This can affect performance.
-          Memory overhead: The GetItem() method uses a single buffer to retrieve the whole file content.

Pages