的AppFabric的UI不直接與在大多數情況下,工作流程或WorkflowServiceHost中溝通,但使用WorkflowControlEndpoint和WorkflowControlClient這樣做。如果你願意,你可以從你的代碼中做同樣的事情。
默認情況下,WorkflowControlEndpoint使用NetNamedPipeBinding公開自己,因此如果要接受來自另一臺計算機的請求,則需要更改該設置。
的WorkflowServiceHost中配置:
<service name="MyWorkflow「
behaviorConfiguration="MyWorkflowBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080/MyWorkflow" />
</baseAddresses>
</host>
<endpoint address=""
binding="basicHttpBinding"
contract="IMyWorkflow" />
<endpoint kind="workflowControlEndpoint"
address="Control"
binding="basicHttpBinding" />
</service>
客戶端代碼:
var instanceId = <<an existing workflow instanceId>>;
var controlBinding = new BasicHttpBinding();
var controlAddress =
new EndpointAddress("http://localhost:8080/MyWorkflow/Control");
var proxy = new WorkflowControlClient(controlBinding, controlAddress);
proxy.Suspend(instanceId);
謝謝!我知道這可以做到。 –