Associating Web Services with Application Pools

Applies to: SharePoint Foundation 2010

Web services execute in the context of an application pool. The application pool is a worker process that runs as an account that is specified when the application pool is created. The Service Application Framework infrastructure manages these application pools and provides both an administrative experience (such as user interface and Windows PowerShell cmdlets) and a class library for associating the application pools with your Web service.

You can associate Web services with application pools in the following ways:

  • Using the Evaluation Mode or Farm Configuration Wizard

  • Creating a user interface for a new service application

  • Using a new-SPServiceApplicationPool in a Windows PowerShell cmdlet

Using Evaluation Mode or the Farm Configuration Wizard

In scenarios where you use Evaluation Mode or the Farm Configuration Wizard to associate a Web service with an application pool, the Service Application Framework infrastructure provisions a default set of service applications. The infrastructure also creates a default application pool and passes it to the service application provisioning code, which can opt-in to share this application pool.

To associate a Web service with an application pool by using Evaluation Mode or the Farm Configuration Wizard

  1. Implement IServiceAdministration::CreateApplication.

  2. Pass the SPServiceApplicationPool property of the SPServiceProvisioningContext argument to the constructor of your SPIisWebServiceApplication derived class.

Creating a User Interface for a "New Service Application"

You must provide a user interface for administrators to use when they create a service application.

To create a user interface for administrators to create a new service application

  1. Pass the GetOrCreateApplicationPool method return value to the constructor of your SPIisWebServiceApplication derived class.

  2. Host the IisWebServiceApplicationPoolSection control in your service application creation UI.

Creating a "New Service Application Pool" Windows PowerShell cmdlet

The New-SPServiceApplicationPool cmdlets creates a Web service application pool in Internet Information Services (IIS).

To create a new service application Windows PowerShell cmdlet

  • Create a Windows PowerShell cmdlet by using the New verb, and then add a required –Account parameter of type SPIisWebServiceApplicationPoolPipeBind.

    c:\sample>New-SPServiceApplicationPool –Name SampelWebServiceApplicationPool –Account testdomain\user1
    
  • Pass the Read return value to the constructor of your SPServiceApplication derived class.

See Also

Concepts

Provisioning Service Applications

Administering Service Applications Using the SharePoint 2010 Management Shell