Service Application Framework Architecture
Applies to: SharePoint Foundation 2010
The Service Application Framework provides a platform that enables developers to build scalable middle-tier applications hosted in SharePoint 2010, that provide data or processing resources to other SharePoint 2010 Web services. The Service Application Framework enables services to be shared between computers on a server farm; it also helps load balance and manage services in SharePoint 2010.
SharePoint Foundation 2010 contains over 20 service applications built using the Service Application Framework. For example, search is implemented using Service Application Framework.
The Service Application Framework service model provides a shared management user interface, bringing consistency to service management. It provides a shared infrastructure that enables you to focus on business logic. You do not need to write code for basic or "housekeeping" tasks such as creating an Internet Information Services (IIS) Web site, installing a Secure Sockets Layer (SSL) certificate, creating a virtual directory, managing application pool credentials, managing and caching distributed settings, tracking and load-balancing endpoints, or backing up and restoring databases. SharePoint Foundation 2010 offers a highly structured server-side object model that makes it easy to access objects that represent the various aspects of a Web site.
Services are instantiated as service applications. Any number of service applications can exist in a farm. Web applications are associated with service applications. Service applications can be shared outside the farm and used remotely.
Reasons to use the Service Application Framework include the following:
To provide specialized computations and analytics that are consumable by multiple SharePoint Web applications
To share data across sites and site collections, providing multiple instances of your application in a farm for hosting scenarios
To execute long-running operations
To use the common management and provisioning infrastructure provided by the Service Application Framework
Service Application Framework Features and Feature Integration
The Service Application Framework provides:
Integration with common SharePoint 2010 features
Integration with the standard SharePoint 2010 management experience by using SharePoint 2010 Central Administration
Integration with the Windows Communication Foundation (WCF)
Windows PowerShell support
Easier implementation of backup and restore (see Implementing Backup and Restore)
Implementation of Cross farm federation (see Implementing Cross-Farm Federation)
Easier implementation of load balancing (see Implementing Load Balancing)
Service Application Framework services can take advantage of the following common SharePoint 2010 features:
A configuration store within the SharePoint 2010 configuration database for application settings
A common SQL Server database provisioning infrastructure (to use your own database to store data)
Support for storing data in custom databases that are managed by SharePoint Foundation 2010
A location to host middle-tier Web services
A mechanism for provisioning Web services and managing their security
A service-scoped timer job infrastructure that enables you to perform scheduled operations on your service or on Web applications that consume it
Integration with SharePoint Management Experience
The Service Application Framework offers integration with the SharePoint Foundation 2010 management experience. Services plug their management user interface into the SharePoint Service Management page providing a common experience for administrators. Services benefit from common SharePoint 2010 administration tools such as Upgrade, Backup/Restore, and Account management. This provides a common user interface that administrators can use to manage, start, stop, group, associate, federate, and back up SharePoint 2010 services.
Services can define their own additional specialized administration roles. Service administration can also be delegated to users who are not farm administrators. In this case, the Central Administration user interface is security-trimmed to show only the pages that the service application administrator has rights to access.
SharePoint 2010 provides a set of interfaces for registering services in the configuration database. Registered services can be managed through the SharePoint Central Administration site, Windows PowerShell commands, and the SharePoint 2010 API.
The following management operations are supported:
Starting and stopping service instances
Updating credentials and passwords for service instances
Creating and deleting service applications
Managing settings for services, service instances, and service applications
Associating Web applications with service applications
Connecting to service applications on remote server farms
Backing up and restoring service applications
For more information, see Integrating Service Applications with the Manage Services Applications Page.
Windows Communication Foundation
The WCF service model addresses communication between clients and services; the SharePoint 2010 service model addresses deployment, management, and discovery of services in a server farm. These two models are complementary.
The SharePoint 2010 service model is ideal for deploying, managing and discovering WCF service clients and endpoints. The Service Application Framework does not, however, require the use of WCF. A service built on this framework could communicate using any protocol it chooses.
For more information about integrating Service Application Framework applications with WCF, see Integrating with Windows Communication Foundation (WCF).
For a detailed example of creating a custom WCF service, see Creating a Custom WCF Service in SharePoint Foundation.
SharePoint 2010 Management Console and Windows PowerShell
SharePoint Foundation 2010 includes the SharePoint Management Shell, which provides an extensive set of Windows PowerShell commands written for SharePoint 2010.
In addition to the cmdlets provided with the SharePoint Management Shell, a service developer can build additional Windows PowerShell cmdlets for provisioning and managing service applications.
If you prefer to use your existing Windows PowerShell window, the SharePoint cmdlets are available in Windows PowerShell window after you have loaded the SharePoint 2010 snap-in.
For more information see Administering Service Applications Using the SharePoint 2010 Management Shell.
For more information about Windows PowerShell, see What's New: Windows PowerShell for SharePoint.
Steps to Building a Service Application Framework Application
Building and deploying Service Application Framework application requires several tasks.
To build a service application
Create a service application
Create a WCF service application endpoint
Write the service application installation code
Install and provision the service application
Create the service application proxy
Write the service application proxy installation code
Install and provision the service application proxy
Create the service application consumers
Install, deploy, and test the service application consumers