Project Description
A Visual Studio 2012 solution which demonstrates a pattern whereby a SharePoint application (_layouts) page is used as a service which can be called from client-side (Javascript) code.

This project uses a SharePoint application to implement a pseudo-service which returns JSON encoded data to callers.

When you otherwise might choose a solution involving a HTTP handler, ASMX or WCF service, it might seem like over engineering a solution to solve a relatively small problem. In these cases, this approach can be used instead, with the added benefit of the application page being scoped, and contextualised, to the site the application page is called against.

The client-side javascript makes a POST request to the URL of the application page, with the POST body containing the name of the service operation to execute, and the parameter [values] required by the operation.

The service executes the operation and returns its results as a JSON encoded response.

Last edited May 31, 2013 at 4:43 PM by platinumdogs, version 5