Поделиться через


Create Method (String, String, AuthorizationMode, Int32, Int32)

Creates a new instance of the MarketingContext class using the specified Marketing Web service in Database mode and authorization policy configuration to manager authorization credentials.

Namespace:  Microsoft.CommerceServer.Marketing
Assembly:  Microsoft.CommerceServer.Marketing.CrossTierTypes (in Microsoft.CommerceServer.Marketing.CrossTierTypes.dll)

Syntax

'Declaration
Public Shared Function Create ( _
    siteName As String, _
    authorizationPolicyFullPath As String, _
    authorizationMode As AuthorizationMode, _
    sqlCommandTimeoutSeconds As Integer, _
    sqlLongRunningCommandTimeoutSeconds As Integer _
) As MarketingContext
'Usage
Dim siteName As String
Dim authorizationPolicyFullPath As String
Dim authorizationMode As AuthorizationMode
Dim sqlCommandTimeoutSeconds As Integer
Dim sqlLongRunningCommandTimeoutSeconds As Integer
Dim returnValue As MarketingContext

returnValue = MarketingContext.Create(siteName, _
    authorizationPolicyFullPath, authorizationMode, _
    sqlCommandTimeoutSeconds, sqlLongRunningCommandTimeoutSeconds)
public static MarketingContext Create(
    string siteName,
    string authorizationPolicyFullPath,
    AuthorizationMode authorizationMode,
    int sqlCommandTimeoutSeconds,
    int sqlLongRunningCommandTimeoutSeconds
)
public:
static MarketingContext^ Create(
    String^ siteName, 
    String^ authorizationPolicyFullPath, 
    AuthorizationMode authorizationMode, 
    int sqlCommandTimeoutSeconds, 
    int sqlLongRunningCommandTimeoutSeconds
)
public static function Create(
    siteName : String, 
    authorizationPolicyFullPath : String, 
    authorizationMode : AuthorizationMode, 
    sqlCommandTimeoutSeconds : int, 
    sqlLongRunningCommandTimeoutSeconds : int
) : MarketingContext

Parameters

  • siteName
    Type: System..::.String
    The name of Commerce Server site that the current instance represents.
  • authorizationPolicyFullPath
    Type: System..::.String
    The path to authorization policy XML file.
  • sqlCommandTimeoutSeconds
    Type: System..::.Int32
    The number of seconds to wait for normal SQL commands to execute. Default is 30 seconds.
  • sqlLongRunningCommandTimeoutSeconds
    Type: System..::.Int32
    The number of seconds to wait for long-running SQL commands to execute. Default is 120 seconds.

Return Value

Type: Microsoft.CommerceServer.Marketing..::.MarketingContext
An object used to mange CampaignItem, Customer, DisplaySizeDisplayTemplate, Expression, IndustryCode, MailingList, PageGroup, profile definitions and site terms, and PromoCodeDefinition, entities.

Remarks

A static overloaded method to create Local-mode or Remote-mode Marketing system objects used to run against the Marketing Web Service.

MarketingContext is often referred to as the Marketing System Agent object, since it is used to communicate with a Web service. The MarketingContext objects uses the services of a MarketingServiceAgent to negotiate an appropriate authentication method with the Marketing Web service and manages authentication credentials used to authenticate the user to the service. It is also possible to manage Web service authentication credentials manually. This can be done by explicitly setting Credentials before constructing the MarketingContext object.

Permissions

See Also

Reference

MarketingContext Class

MarketingContext Members

Create Overload

Microsoft.CommerceServer.Marketing Namespace