Share via


How to Configure a Web Application on the Presentation Tier

This topic provides information to help you configure the Web application in the presentation tier to access the Commerce Foundation on the application tier in a three-tier commerce deployment. You define these configuration settings in Web.config on the presentation tier.

Use one of the ways below to configure a Web application on the presentation tier:

  • Manually configure the Web Application on the presentation tier, or

  • Configure a SharePoint 2010 Web Application on the Presentation Tier Using Windows PowerShell

Prerequisites

  • The application tier configuration is complete.

  • You know the binding type and the URL defined for the Commerce Foundation operation service endpoint on the application tier. The Commerce Foundation service and client endpoints must use compatible binding types.

Manually Configuring the Web Application on the Presentation Tier

Perform the following procedures in the order listed below to configure your application to behave as a Commerce Foundation service client in the presentation tier of a three-tier deployment.

To manually configure the Web application on the presentation tier

  1. Configure the Application Client to Run in "Service" mode

  2. Configure the WCF Binding Type and the Client Service Endpoint

In a three-tier deployment, if your commerce client application is receiving messages that contain large amount of data, consider setting the maximum WCF message size (maxReceivedMessageSize parameter) to a higher value. For more information, see How to Change the Value for the Maximum WCF Message Size.

Configure the Application Client to Run in "Service" Mode

In a three-tier deployment, the Commerce Foundation client endpoint must be configured to run in service mode.

The following example highlights Web application endpoints configured to run in service mode.

<microsoft.commerce>
 
   <client>
      <CommerceOperationServices>
        <CommerceOperationService name="IOperationService" mode="Service" clientEndpointName="Foundation" />
        <CommerceOperationService name="IOperationService_Federated" mode="Service" clientEndpointName="Foundation_Federated" />
        <CommerceOperationService name="IOperationService_Anonymous" mode="Service" clientEndpointName="Foundation_Anonymous" />
      </CommerceOperationServices>
   </client>
 
</microsoft.commerce>

Configure the WCF Binding Type for the Client Endpoint

Specify the type of binding used by the Web application client endpoint to connect to the Commerce Foundation operation service. 

Following is a configuration example using WCF wsHttpBinding binding between the client endpoint and the Commerce Foundation service endpoint.

Hh567637.alert_caution(en-us,CS.95).gifImportant Note:

The binding type defined on the client endpoint must be compatible with the corresponding service endpoint defined on the application tier.

In this example, the Windows identity of the application pool is forwarded to the application tier.

For more information about other WCF security implementation, https://go.microsoft.com/fwlink/?LinkId=199910

  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="wsHttpBinding_OperationService" sendTimeout="01:00:00">
        </binding>
      </wsHttpBinding>
    </bindings>

    <client>
      <endpoint name="Foundation" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding_OperationService" address="http://app-tier/Foundation/OperationService.svc" contract="Microsoft.Commerce.IOperationService">
       <identity>
           <userPrincipalName value="domain\user" />
       </identity>
      </endpoint>
    </client>
  </system.serviceModel>

Configuring a SharePoint 2010 Web Application on the Presentation Tier Using Windows PowerShell

This topic provides guidance on how to use the pre-packaged scripts to configure your Microsoft SharePoint 2010 Web application on the presentation tier. This procedure is required after you have deployed a customized Web application into you SharePoint 2010 environment on the target presentation server.

Prerequisites

To configure your Web application for three tier deployment and activate application level features

The following is a sample Microsoft Windows PowerShell script that configures the Foundation client endpoints, specifies required bindings, and enables features in a SharePoint 2010 Web application. In this sample, the Windows PowerShell script configures application level features that are provided with the SharePoint Commerce Services Extensibility Kit.

Note

The following script commands execute timer jobs. Make sure to allow sufficient time for the timer jobs to complete before executing any subsequent process.

# Add CS Site Name
$wa = Get-SPWebApplication $WebSiteUrl

$wa.Properties["IsDistributedFoundation"] = $IsDistributedFoundation
$wa.Properties["CommerceServerSiteName"] = $CommerceServerSiteName
$wa.Properties["FoundationServiceEndPoint"] = $FoundationServiceEndPoint
$wa.Properties["FoundationServiceEndPointFederatedAccess"] = $FoundationServiceEndPointFederatedAccess
$wa.Properties["FoundationServiceEndPointAnonymousAccess"] = $FoundationServiceEndPointAnonymousAccess
$wa.Properties["UserPrincipalName"] = $UserPrincipalName

# Write-Host "Enabling the CS Features : " -nonewline
Enable-SPFeature -identity "Resources" -URL $wa.Url
Enable-SPFeature -identity "CommerceServerStorefrontSiteResourceDeployment" -URL $wa.Url
Enable-SPFeature -identity "SilverlightWebConfig" -URL $wa.Url
Enable-SPFeature -identity "CommerceServer" -URL $wa.Url
$job = Get-SPTimerJob -identity "job-deploy-commerce-server-activation" -WebApplication $wa
$jobIsDone = $false
do
{
    sleep 1
    if($job.HistoryEntries)
    {
        foreach($entry in $job.HistoryEntries)
        {
            $jobIsDone = $true;
            Write-Host "The commerce server feature activation job finished in " ($entry.EndTime - $entry.StartTime).TotalSeconds " seconds "
        }
    }
}
while(!$jobIsDone)

Write-Host " done" -foregroundcolor darkgreen

Write-Host "Waiting 20 seconds to ensure that the feature activation code is properly executed in all farm nodes:" -nonewline
sleep 20
Write-Host " done" -foregroundcolor darkgreen

See Also

Other Resources

Building the Presentation Tier in a SharePoint 2010 Commerce Deployment