WorkflowServiceHost 類別

定義

為工作流程提供主機。Provides a host for workflows. 支援傳訊活動、建立多個執行個體及組態等功能。Supports features like messaging activities, multi-instancing, and configuration.

public ref class WorkflowServiceHost : System::ServiceModel::ServiceHostBase
public class WorkflowServiceHost : System.ServiceModel.ServiceHostBase
type WorkflowServiceHost = class
    inherit ServiceHostBase
Public Class WorkflowServiceHost
Inherits ServiceHostBase
繼承

範例

下列範例將示範如何使用 WorkflowServiceHost 類別。The following example shows how to use the WorkflowServiceHost class.

Console.WriteLine("Starting up...");
WorkflowService service = CreateService();
Uri address = new Uri(Constants.ServiceBaseAddress);
WorkflowServiceHost host = new WorkflowServiceHost(service, address);

try
{
    Console.WriteLine("Opening service...");
    host.Open();

    Console.WriteLine("Service is listening on {0}...", address);
    Console.WriteLine("To terminate press ENTER");
    Console.ReadLine();
}
catch (Exception ex)
{
    Console.WriteLine("Service terminated with exception {0}", ex.ToString());
}
finally
{
    host.Close();
}

建構函式

WorkflowServiceHost()

初始化 WorkflowServiceHost 類別的新執行個體。Initializes a new instance of the WorkflowServiceHost class.

WorkflowServiceHost(Activity, Uri[])

使用指定的活動和基底位址,初始化 WorkflowServiceHost 類別的新執行個體。Initializes a new instance of the WorkflowServiceHost class using the specified activity and base addresses.

WorkflowServiceHost(Object, Uri[])

使用指定的服務物件和基底位址,初始化 WorkflowServiceHost 類別的新執行個體。Initializes a new instance of the WorkflowServiceHost class using the specified service object and base addresses.

WorkflowServiceHost(WorkflowService, Uri[])

使用指定的服務定義和基底類別集合,初始化 WorkflowServiceHost 類別的新執行個體。Initializes a new instance of the WorkflowServiceHost class using the specified service definition and collection of base addresses.

屬性

Activity

取得裝載之工作流程服務的根活動。Gets the root activity of the hosted workflow service.

Authentication

取得服務驗證行為。Gets the service authentication behavior.

(繼承來源 ServiceHostBase)
Authorization

取得裝載之服務的授權行為。Gets the authorization behavior for the service hosted.

(繼承來源 ServiceHostBase)
BaseAddresses

取得裝載之服務使用的基底位址。Gets the base addresses used by the hosted service.

(繼承來源 ServiceHostBase)
ChannelDispatchers

取得服務主機使用的通道發送器集合。Gets the collection of channel dispatchers used by the service host.

(繼承來源 ServiceHostBase)
CloseTimeout

取得或設定允許服務主機關閉的時間間隔。Gets or sets the interval of time allowed for the service host to close.

(繼承來源 ServiceHostBase)
Credentials

取得裝載之服務的認證。Gets the credential for the service hosted.

(繼承來源 ServiceHostBase)
DefaultCloseTimeout

取得允許服務主機關閉的預設時間間隔。Gets the default interval of time allowed for the service host to close.

(繼承來源 ServiceHostBase)
DefaultOpenTimeout

取得允許服務主機開啟的預設時間間隔。Gets the default interval of time allowed for the service host to open.

(繼承來源 ServiceHostBase)
Description

取得裝載之服務的描述。Gets the description of the service hosted.

(繼承來源 ServiceHostBase)
DurableInstancingOptions

取得與工作流程服務主機相關聯的 DurableInstancingOptionsGets the DurableInstancingOptions associated with the workflow service host.

Extensions

取得目前指定服務主機的延伸。Gets the extensions for the current specified service host.

(繼承來源 ServiceHostBase)
ImplementedContracts

擷取由裝載之服務實作的合約。Retrieves the contracts implemented by the service hosted.

(繼承來源 ServiceHostBase)
IsDisposed

取得值,這個值表示是否已經處置通訊物件。Gets a value that indicates whether the communication object has been disposed.

(繼承來源 CommunicationObject)
ManualFlowControlLimit

取得或設定由裝載之服務接收的訊息流量控制限制。Gets or sets the flow control limit for messages received by the service hosted.

(繼承來源 ServiceHostBase)
OpenTimeout

取得或設定允許服務主機開啟的時間間隔。Gets or sets the interval of time allowed for the service host to open.

(繼承來源 ServiceHostBase)
State

取得值,這個值表示通訊物件目前的狀態。Gets a value that indicates the current state of the communication object.

(繼承來源 CommunicationObject)
SupportedVersions

取得這個工作流程服務主機所支援的工作流程版本清單。Gets a list of workflow versions that are supported by this workflow service host.

ThisLock

取得會在狀態轉換期間保護類別執行個體的互斥鎖定。Gets the mutually exclusive lock that protects the class instance during a state transition.

(繼承來源 CommunicationObject)
WorkflowExtensions

取得 WorkflowInstanceExtensionManager 物件,以便在工作流程服務執行個體中加入或移除延伸。Gets a WorkflowInstanceExtensionManager object to add or remove extensions to the workflow service instance.

方法

Abort()

導致通訊物件立即從目前的狀態轉換為關閉狀態。Causes a communication object to transition immediately from its current state into the closing state.

(繼承來源 CommunicationObject)
AddBaseAddress(Uri)

將基底位址新增至服務主機。Adds a base address to the service host.

(繼承來源 ServiceHostBase)
AddDefaultEndpoints()

針對在具有預設繫結的服務主機上找到的各個合約,為所有的基底位址加入服務端點。Adds service endpoints for all base addresses in each contract found in the service host with the default binding.

(繼承來源 ServiceHostBase)
AddServiceEndpoint(ServiceEndpoint)

將服務端點加入至工作流程服務主機。Adds a service endpoint to the workflow service host.

AddServiceEndpoint(String, Binding, String)

使用指定的合約、繫結和位址,將服務端點加入至工作流程服務主機。Adds a service endpoint to the workflow service host using the specified contract, binding, and address.

AddServiceEndpoint(String, Binding, String, Uri)

使用指定的合約、繫結端點位址和接聽 URI,將服務端點加入至工作流程服務主機。Adds a service endpoint to the workflow service host using the specified contract, binding, endpoint address, and listen URI.

AddServiceEndpoint(String, Binding, Uri)

使用指定的合約、繫結和位址,將服務端點加入至工作流程服務主機。Adds a service endpoint to the workflow service host using the specified contract, binding, and address.

AddServiceEndpoint(String, Binding, Uri, Uri)

使用指定的合約、繫結端點位址和接聽 URI,將服務端點加入至工作流程服務主機。Adds a service endpoint to the workflow service host using the specified contract, binding, endpoint address, and listen URI.

AddServiceEndpoint(XName, Binding, String, Uri, String)

使用指定的合約、繫結端點位址、接聽 URI,以及行為組態名稱,將服務端點加入至工作流程服務主機。Adds a service endpoint to the workflow service host using the specified contract, binding, endpoint address, listen URI, and behavior configuration name.

AddServiceEndpoint(XName, Binding, Uri, Uri, String)

使用指定的實作合約、繫結、端點位址、接聽 URI,以及行為組態名稱,將服務端點加入至工作流程服務主機。Adds a service endpoint to the workflow service host using the specified implemented contract, binding, endpoint address, listen URI, and a behavior configuration name.

ApplyConfiguration()

從組態檔載入服務描述資訊,並將其套用至正在建構的執行階段。Loads the service description information from the configuration file and applies it to the runtime being constructed.

(繼承來源 ServiceHostBase)
BeginClose(AsyncCallback, Object)

開始非同步作業以關閉通訊物件。Begins an asynchronous operation to close a communication object.

(繼承來源 CommunicationObject)
BeginClose(TimeSpan, AsyncCallback, Object)

開始非同步作業,關閉有已指定逾時的通訊物件。Begins an asynchronous operation to close a communication object with a specified timeout.

(繼承來源 CommunicationObject)
BeginOpen(AsyncCallback, Object)

開始非同步作業以開啟通訊物件。Begins an asynchronous operation to open a communication object.

(繼承來源 CommunicationObject)
BeginOpen(TimeSpan, AsyncCallback, Object)

開始非同步作業,開啟有已指定時間間隔的通訊物件。Begins an asynchronous operation to open a communication object within a specified interval of time.

(繼承來源 CommunicationObject)
Close()

導致通訊物件從目前的狀態轉換為已關閉狀態。Causes a communication object to transition from its current state into the closed state.

(繼承來源 CommunicationObject)
Close(TimeSpan)

在指定時間間隔內,讓通訊物件從目前的狀態轉換為已關閉狀態。Causes a communication object to transition from its current state into the closed state within a specified interval of time.

(繼承來源 CommunicationObject)
CreateDescription(IDictionary<String,ContractDescription>)

使用指定之位址、繫結、合約和行為服務端點資訊的索引鍵/值組,建立裝載之工作流程服務的服務描述。Creates a service description of the hosted workflow service using the specified key/value pair collection of address, binding, contract and behavior service endpoint information.

EndClose(IAsyncResult)

完成非同步作業以關閉通訊物件。Completes an asynchronous operation to close a communication object.

(繼承來源 CommunicationObject)
EndOpen(IAsyncResult)

完成非同步作業以開啟通訊物件。Completes an asynchronous operation to open a communication object.

(繼承來源 CommunicationObject)
Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
Fault()

導致通訊物件從目前的狀態轉換為錯誤狀態。Causes a communication object to transition from its current state into the faulted state.

(繼承來源 CommunicationObject)
GetCommunicationObjectType()

取得通訊物件的型別。Gets the type of communication object.

(繼承來源 CommunicationObject)
GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
IncrementManualFlowControlLimit(Int32)

使用指定的增量,增加前往裝載之服務的訊息流量率限制。Increases the limit on the flow rate of messages to the hosted service by a specified increment.

(繼承來源 ServiceHostBase)
InitializeDescription(UriSchemeKeyedCollection)

使用合約和服務描述建立並初始化服務主機。Creates and initializes the service host with the contract and service descriptions.

(繼承來源 ServiceHostBase)
InitializeRuntime()

初始化工作流程服務主機的執行階段。Initializes the runtime for the workflow service host.

LoadConfigurationSection(ServiceElement)

從裝載之服務的組態檔載入服務項目。Loads the service element from the configuration file of the hosted service.

(繼承來源 ServiceHostBase)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
OnAbort()

在中止工作流程服務主機時呼叫。Called when the workflow service host is aborted.

OnBeginClose(TimeSpan, AsyncCallback, Object)

開始關閉工作流程服務主機時所叫用的非同步作業。Begins an asynchronous operation invoked when the workflow service host is closed.

OnBeginOpen(TimeSpan, AsyncCallback, Object)

開始開啟工作流程服務主機時所叫用的非同步作業。Begins an asynchronous operation invoked when the workflow service host is opened.

OnClose(TimeSpan)

關閉裝載的服務,包括通道發送器以及相關聯的執行個體內容和接聽程式。Closes down the hosted service, including the channel dispatchers and associated instance contexts and listeners.

OnClosed()

釋放服務主機使用的資源。Releases resources used by the service host.

(繼承來源 ServiceHostBase)
OnClosing()

在將通訊物件轉換為關閉狀態期間會叫用。Invoked during the transition of a communication object into the closing state.

(繼承來源 CommunicationObject)
OnEndClose(IAsyncResult)

完成關閉工作流程服務主機時所叫用的非同步作業。Completes an asynchronous operation invoked when the workflow service host is closed.

OnEndOpen(IAsyncResult)

完成開啟工作流程服務主機時所叫用的非同步作業。Completes an asynchronous operation invoked when the workflow service host is opened.

OnFaulted()

在通訊物件上插入處理 (當它因為叫用同步錯誤作業而轉換到錯誤狀態之後)。Inserts processing on a communication object after it transitions to the faulted state due to the invocation of a synchronous fault operation.

(繼承來源 CommunicationObject)
OnOpen(TimeSpan)

開啟通道發送器。Opens the channel dispatchers.

OnOpened()

取得裝載之服務的服務認證、服務驗證及授權行為。Gets the service credentials,service authentication and authorization behavior for the hosted service.

(繼承來源 ServiceHostBase)
OnOpening()

在將通訊物件轉換至開啟狀態期間會叫用。Invoked during the transition of a communication object into the opening state.

(繼承來源 CommunicationObject)
Open()

導致通訊物件從已建立狀態轉換為已開啟狀態。Causes a communication object to transition from the created state into the opened state.

(繼承來源 CommunicationObject)
Open(TimeSpan)

在指定時間間隔內,讓通訊物件從已建立狀態轉換為已開啟狀態。Causes a communication object to transition from the created state into the opened state within a specified interval of time.

(繼承來源 CommunicationObject)
ReleasePerformanceCounters()

釋放裝載之服務的服務和通道發送器效能計數器。Releases the service and channel dispatcher performance counters for the hosted service.

(繼承來源 ServiceHostBase)
SetEndpointAddress(ServiceEndpoint, String)

將指定之端點的端點位址設定為指定的位址。Sets the endpoint address of the specified endpoint to the specified address.

(繼承來源 ServiceHostBase)
ThrowIfDisposed()

如果已處置通訊物件,則會擲回例外狀況。Throws an exception if the communication object is disposed.

(繼承來源 CommunicationObject)
ThrowIfDisposedOrImmutable()

如果通訊物件的 State 屬性並未設定為 Created 狀態,就會擲回例外狀況。Throws an exception if the communication object the State property is not set to the Created state.

(繼承來源 CommunicationObject)
ThrowIfDisposedOrNotOpen()

如果通訊物件不是處於 Opened 狀態,就會擲回例外狀況。Throws an exception if the communication object is not in the Opened state.

(繼承來源 CommunicationObject)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

事件

Closed

當通訊物件轉換至已關閉狀態時發生。Occurs when a communication object transitions into the closed state.

(繼承來源 CommunicationObject)
Closing

當通訊物件轉換至關閉狀態時就會發生。Occurs when a communication object transitions into the closing state.

(繼承來源 CommunicationObject)
Faulted

當通訊物件轉換至錯誤狀態時發生。Occurs when a communication object transitions into the faulted state.

(繼承來源 CommunicationObject)
Opened

當通訊物件轉換至已開啟狀態時發生。Occurs when a communication object transitions into the opened state.

(繼承來源 CommunicationObject)
Opening

當通訊物件轉換至開啟狀態時發生。Occurs when a communication object transitions into the opening state.

(繼承來源 CommunicationObject)
UnknownMessageReceived

發生於收到未知訊息時。Occurs when an unknown message is received.

(繼承來源 ServiceHostBase)

明確介面實作

IDisposable.Dispose()

關閉服務主機。Closes the service host.

(繼承來源 ServiceHostBase)

適用於