WorkflowServiceHost 类
定义
注意
The WF3 types are deprecated. Instead, please use the new WF4 types from System.Activities.*
为基于工作流的服务提供主机。Provides host for workflow-based services.
public ref class WorkflowServiceHost : System::ServiceModel::ServiceHostBase
public class WorkflowServiceHost : System.ServiceModel.ServiceHostBase
[System.Obsolete("The WF3 types are deprecated. Instead, please use the new WF4 types from System.Activities.*")]
public class WorkflowServiceHost : System.ServiceModel.ServiceHostBase
type WorkflowServiceHost = class
inherit ServiceHostBase
[<System.Obsolete("The WF3 types are deprecated. Instead, please use the new WF4 types from System.Activities.*")>]
type WorkflowServiceHost = class
inherit ServiceHostBase
Public Class WorkflowServiceHost
Inherits ServiceHostBase
- 继承
- 属性
注解
实现 Windows Communication Foundation (WCF) 服务模型编程模型所使用的主机。Implements the host used by the Windows Communication Foundation (WCF) service model programming model.
当您没有使用 Internet 信息服务 (IIS) 或 Windows 激活服务 (WAS) 公开服务时,请使用 WorkflowServiceHost 类来配置和公开工作流作为服务以供客户端应用程序使用。Use the WorkflowServiceHost class to configure and expose a workflow as service for use by client applications when you are not using Internet Information Services (IIS) or Windows Activation Services (WAS) to expose a service. IIS 和 WAS 均代表您与 WorkflowServiceHost 对象交互。Both IIS and WAS interact with a WorkflowServiceHost object on your behalf.
若要公开工作流作为服务以供调用方使用,WCF 需要完整的服务说明(由 ServiceDescription 类表示)。To expose a workflow as service for use by callers, WCF requires a complete service description (represented by the ServiceDescription class). WorkflowServiceHost 类根据工作流服务类型和配置信息创建 ServiceDescription,然后再使用该说明为说明中的每个终结点创建 ChannelDispatcher 对象。The WorkflowServiceHost class creates a ServiceDescription from the workflow service type and configuration information and then uses that description to create ChannelDispatcher objects for each endpoint in the description.
使用 WorkflowServiceHost 对象可加载工作流服务、配置终结点、应用安全设置并启动侦听器来处理传入的请求。Use a WorkflowServiceHost object to load a workflow service, configure endpoints, apply security settings, and start listeners to handle incoming requests.
构造函数
WorkflowServiceHost() |
初始化 WorkflowServiceHost 类的新实例。Initializes a new instance of the WorkflowServiceHost class. |
WorkflowServiceHost(Stream, Stream, ITypeProvider, Uri[]) |
使用包含工作流定义的字节流、包含工作流规则定义的字节流、自定义活动类型的类型提供程序和指定的服务基址初始化 WorkflowServiceHost 类的新实例。Initializes a new instance of the WorkflowServiceHost class using a byte stream that contains the workflow definition, a byte stream that contains the workflow rules definition, a type provider for custom activity types, and the base addresses of the service specified. |
WorkflowServiceHost(Stream, Stream, Uri[]) |
使用包含工作流定义的字节流、包含工作流规则定义的字节流和指定的服务基址初始化 WorkflowServiceHost 类的新实例。Initializes a new instance of the WorkflowServiceHost class using a byte stream that contains the workflow definition, a byte stream that contains the workflow rules definition, and the base addresses of the service specified. |
WorkflowServiceHost(Stream, Uri[]) |
使用包含工作流定义的字节流和指定的服务基址初始化 WorkflowServiceHost 类的新实例。Initializes a new instance of the WorkflowServiceHost class using a byte stream that contains the workflow definition and the base addresses of the service specified. |
WorkflowServiceHost(String, String, ITypeProvider, Uri[]) |
使用工作流定义的路径、工作流规则定义的路径、自定义活动类型的类型提供程序和指定的服务基址初始化 WorkflowServiceHost 类的新实例。Initializes a new instance of the WorkflowServiceHost class using a path to the workflow definition, a path to the workflow rules definition, a type provider for custom activity types, and the base addresses of the service specified. |
WorkflowServiceHost(String, String, Uri[]) |
使用工作流定义的路径、工作流规则定义的路径和指定的服务基址初始化 WorkflowServiceHost 类的新实例。Initializes a new instance of the WorkflowServiceHost class using a path to the workflow definition, a path to the workflow rules definition, and the base addresses of the service specified. |
WorkflowServiceHost(String, Uri[]) |
使用工作流定义的路径和指定的服务基址初始化 WorkflowServiceHost 类的新实例。Initializes a new instance of the WorkflowServiceHost class using a path to the workflow definition and the base addresses of the service specified. |
WorkflowServiceHost(Type, Uri[]) |
使用工作流类型和指定的服务基址初始化 WorkflowServiceHost 类的新实例。Initializes a new instance of the WorkflowServiceHost class using a workflow type and the base addresses of the service specified. |
属性
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) |
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) |
ThisLock |
获取在状态转换过程中保护类实例的相互排斥锁。Gets the mutually exclusive lock that protects the class instance during a state transition. (继承自 CommunicationObject) |
方法
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 the specified service endpoint to the hosted service. (继承自 ServiceHostBase) |
AddServiceEndpoint(String, Binding, String) |
使用指定的协定、绑定和终结点地址将服务终结点添加到承载服务中。Adds a service endpoint to the hosted service with a specified contract, binding, and endpoint address. (继承自 ServiceHostBase) |
AddServiceEndpoint(String, Binding, String, Uri) |
使用指定的协定、绑定和终结点地址以及包含服务所侦听地址的 URI,将服务终结点添加到承载服务中。Adds a service endpoint to the hosted service with a specified contract, binding, endpoint address and URI that contains the address at which it listens. (继承自 ServiceHostBase) |
AddServiceEndpoint(String, Binding, Uri) |
使用指定的协定、绑定和包含终结点地址的 URI 将服务终结点添加到承载服务中。Adds a service endpoint to the hosted service with a specified contract, binding, and a URI that contains the endpoint address. (继承自 ServiceHostBase) |
AddServiceEndpoint(String, Binding, Uri, Uri) |
使用指定的协定、绑定和包含终结点与所侦听地址的 URI,将服务终结点添加到承载服务。Adds a service endpoint to the hosted service with the specified contract, binding, and URIs that contain the endpoint and listening addresses. (继承自 ServiceHostBase) |
AddServiceEndpoint(Type, Binding, String) |
使用指定的协定、绑定和终结点地址为工作流服务添加服务终结点。Adds a service endpoint for the workflow service using the specified contract, binding, and endpoint address. |
AddServiceEndpoint(Type, Binding, String, Uri) |
使用指定的协定、绑定和终结点地址以及服务在其上侦听的 URI 将服务终结点添加到工作流服务中。Adds a service endpoint to the workflow service with a specified contract, a binding, an endpoint address, and a URI on which the service listens. |
AddServiceEndpoint(Type, Binding, Uri) |
使用指定的约定、绑定和包含终结点地址的 URI 将服务终结点添加到工作流服务中。Adds a service endpoint to the workflow service with a specified contract, binding, and URI that contains the endpoint address. |
AddServiceEndpoint(Type, Binding, Uri, Uri) |
使用指定的协定、绑定、包含终结点地址的 URI 以及服务在其上侦听的 URI 将服务终结点添加到工作流服务中。Adds a service endpoint to the workflow service with a specified contract, a binding, a URI that contains the endpoint address, and a URI on which the service listens. |
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 description of the workflow service. |
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() |
获取当前实例的 Type。Gets 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 service host. (继承自 ServiceHostBase) |
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() |
中止服务。Aborts the service. (继承自 ServiceHostBase) |
OnBeginClose(TimeSpan, AsyncCallback, Object) |
开始在关闭服务主机时调用的异步操作。Begins an asynchronous operation invoked on the close of the service host. (继承自 ServiceHostBase) |
OnBeginOpen(TimeSpan, AsyncCallback, Object) |
开始在打开服务主机时调用的异步操作。Begins an asynchronous operation invoked on the opening of the service host. (继承自 ServiceHostBase) |
OnClose(TimeSpan) |
关闭所承载服务,包括它们的通道调度程序以及相关的实例上下文和侦听器。Closes down the hosted service, including their channel dispatchers and associated instance contexts and listeners. (继承自 ServiceHostBase) |
OnClosed() |
释放服务主机占用的资源。Releases resources used by the service host. (继承自 ServiceHostBase) |
OnClosing() |
在 WorkflowServiceHost 进入关闭状态前调用此方法。This method is called before the WorkflowServiceHost is put into a closing state. |
OnEndClose(IAsyncResult) |
完成在关闭服务主机时调用的异步操作。Completes an asynchronous operation invoked on the closing of the service host. (继承自 ServiceHostBase) |
OnEndOpen(IAsyncResult) |
完成在打开服务主机时调用的异步操作。Completes an asynchronous operation invoked on the opening of the service host. (继承自 ServiceHostBase) |
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. (继承自 ServiceHostBase) |
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) |