How to Create a Commerce Foundation Operation Service
This topic provides guidance on how to create an instance of a Commerce Foundation operation service on the application tier. In a three-tier deployment topology, the Commerce Foundation is configured to run as a service. A Commerce Foundation operation service is a WCF service that is created as a virtual directory in IIS. You then modify the Web.config file of this new IIS Web application to contain the required Commerce Foundation service endpoint configurations.
Based on your deployment topology and security requirements, you may have to create multiple instances of the Commerce Foundation operation service.
A single Commerce Foundation operation service may define multiple service endpoints based on the bindings and security requirements.
This topic contains the following:
Using a Distinct Commerce Foundation Operation Service for the Routing Service
Using a Distinct Commerce Foundation Operation Service for Anonymous Access
Creating a Commerce Foundation Operation Service
Using a Distinct Commerce Foundation Operation Service for the Routing Service
When a deployment includes a routing service, use a Commerce Foundation operation service specially created for and used only by the routing service.
When you deploy Microsoft Commerce Server 2009 R2 in a three-tier topology with the Microsoft SharePoint 2010 Solution Storefront, you must create an operation service with service endpoints that use federated bindings.
For detailed information about the configuration of a service endpoint that uses federated bindings, see How To Configure an Operation Service with Federated Bindings
Using a Distinct Commerce Foundation Operation Service for Anonymous Access
Create a distinct operation service specifically to handle anonymous access requests. The use of a Commerce Foundation operation service for anonymous access allows you to limit the attack surface by removing any unnecessary operation handlers from the ChannelConfiguration.config associated with the operation service instance.
Creating a Commerce Foundation Operation Service
To create a Web application to contain a Commerce Foundation operation service, use IIS Manager to manually create a new IIS virtual directory that maps to the pre-packaged sample OperationService.svc file. Following is the location of the prepackaged sample: COMMERCE_SERVER_ROOT\Extensibility Kits\Samples\WebApplications\Commerce-App-3Tier
This new Web site must specify an application pool using an account with the required permissions to access the Commerce Server 2009 R2 databases.
The following table lists Commerce Server 2009 R2 resource files that must be present in the Commerce Foundation application virtual directory. Refer to the samples for a complete list and directory structure of the folders and files.
Note
If you use the sample script to deploy the application tier, the following files will be copied in the application directory.
File Name |
File Location |
ChannelConfiguration.config |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier |
MetadataDefinitions.xml |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier |
CatalogAuthorizationStore.xml |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier |
OrdersAuthorizationStore.xml |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier |
ProfilesAuthorizationStore.xml |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier |
CommerceEntityAuthorizationStore.xml |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier |
Foundation.csproj |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier |
OperationService.svc |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier |
OrderObjectMappings.xml |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce |
OrderPipelineMappings.xml |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier |
Web.config |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier |
Web.federated(sample Web.config file with federated bindings) |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier |
Advertisting.pcf |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier\pipelines |
basket.pcf |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier\pipelines |
checkout.pcf |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier\pipelines |
CreditCard.pcf |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier\pipelines |
Discounts.pcf |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier\pipelines |
product.pcf |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier\pipelines |
RecordEvent.pcf |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier\pipelines |
recvpo.pcf |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier\pipelines |
total.pcf |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier\pipelines |
CommerceMessgeManager.DLL |
%COMMERCE_SERVER_ROOT%\Extensibility Kits\Samples\WebApplications\Commerce-App-3-Tier\bin |
Guidance for Creating a Commerce Foundation Operation Service Using a Sample Script
As an alternative to manually creating the Commerce Foundation Web application instance, consider using the sample script DeployASpNet-App-3Tier, pre-packaged with Commerce Server 2009 R2 under …\Microsoft Commerce Server 9.0\Extensibility Kits\Samples\WebApplications.zip.
Following is a sample of the script that creates a new IIS Web application and all the required content within it. You can then customize the configuration of the new Commerce Server 2009 R2 operation service to suit your deployment needs.
SetCommerceWebSite
$currentFolder=Get-ScriptDirectory
$package="$currentFolder\Commerce-App-3Tier.zip"
if(!(test-path $package))
{
$MSBuildPath = "$($(gp -Path HKLM:\Software\Microsoft\'NET Framework Setup'\NDP\v4\Full).InstallPath)MSBuild.exe"
.$MSBuildPath "Commerce-App-3Tier\Foundation.csproj" /T:Package /P:PackageLocation=$package
}
.$MSDeployPath -verb:sync -source:package=Commerce-App-3Tier.zip -dest:auto -setParam:Name=`"IIS Web Application Name`"`,value=$commerceAppWebSite/$commerceFoundation3TierName
.$env:SystemRoot\System32\inetsrv\appcmd.exe set app $commerceAppWebSite/$commerceFoundation3TierName /applicationPool:$commerceAppPoolName
ConfigureSite("$commerceAppWebSitePath\$commerceFoundation3TierName")
After you have created an instance of the Commerce Foundation operation service, configure it to suit your needs. See How to Configure a Commerce Foundation Operation Service Using Windows PowerShell
See Also
Other Resources
Building the Application Tier in a SharePoint 2010 Commerce Deployment
Walkthrough: Deploying a SharePoint 2010 Commerce Solution in a Three-Tier Topology