Redigera

Dela via


WorkflowServiceHostFactory.CreateServiceHost(String, Uri[]) Method

Definition

Creates a WorkflowServiceHost from a string that contains either the file name of the workflow markup file or the type name of the workflow service type and the base address of the service specified.

public:
 override System::ServiceModel::ServiceHostBase ^ CreateServiceHost(System::String ^ constructorString, cli::array <Uri ^> ^ baseAddresses);
public override System.ServiceModel.ServiceHostBase CreateServiceHost (string constructorString, Uri[] baseAddresses);
override this.CreateServiceHost : string * Uri[] -> System.ServiceModel.ServiceHostBase
Public Overrides Function CreateServiceHost (constructorString As String, baseAddresses As Uri()) As ServiceHostBase

Parameters

constructorString
String

The file name of the workflow markup file that defines the workflow service or the type name of the workflow service type.

baseAddresses
Uri[]

An array of type Uri that contains the base addresses for the hosted service.

Returns

A ServiceHostBase object associated with the workflow service. The default implementation returns a WorkflowServiceHost object with the specified base addresses.

Examples

The following is an example of a type-based reference to the workflow service CalculatorServiceWorkflow.

<%@ServiceHost language=c# Debug="true" Factory="System.ServiceModel.Activation.WorkflowServiceHostFactory" Service="CalculatorServiceWorkflow" %>  

The following is an example of a workflow definition file reference to the workflow service CalculatorServiceWorkflow.

<%@ServiceHost language=c# Debug="true" Factory="System.ServiceModel.Activation.WorkflowServiceHostFactory" Service="CalculatorServiceWorkflow.xoml" %>  

Remarks

The constructorString argument could be either a fully qualified workflow type name or it could be the relative file path of the workflow definition file declared in the .svc file in which ServiceHostFactory directives are placed.

Note

To associate a rule definition with a workflow definition, name the rule definition file the same name as the workflow definition file with a .rules extension and place it in same directory as the workflow definition file. For example, the rules definition file CalculatorServiceWorkflow.rules must be in the same directory as CalculatorServiceWorkflow.xoml.

Applies to