共用方式為


HOW TO:設定工作流程服務

設定工作流程服務用戶端類似於設定 Windows Communication Foundation (WCF) 服務,在該服務中使用應用程式組態檔。 工作流程執行階段會設定為服務的行為區段的一部分。 下列範例說明藉由新增做為服務之行為的工作流程執行階段來新增 SqlWorkflowPersistenceService。 以粗體反白顯示工作流程的特定工作流程執行階段區段:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <system.serviceModel>
    <services>
      <service name="Microsoft.WorkflowServices.Samples.SequentialCalculatorService" behaviorConfiguration="ServiceBehavior" >
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8888/ServiceHost/Calculator.svc" />
          </baseAddresses>
        </host>
        
        <endpoint address="" 
                  binding="wsHttpContextBinding" 
                  contract="ICalculator" />
      </service>
    </services>

    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior"  >
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceCredentials>
            <windowsAuthentication
                allowAnonymousLogons="false"
                includeWindowsGroups="true" />
          </serviceCredentials>
          <!-- Comment out the following behavior to disable persistence store -->
          <workflowRuntime name="WorkflowServiceHostRuntime" validateOnCreate="true" enablePerformanceCounters="true">
            <services>
              <add type="System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                   connectionString="Data Source=localhost\sqlexpress;Initial Catalog=NetFx35Samples_ServiceWorkflowStore;Integrated Security=True;Pooling=False"
                   LoadIntervalSeconds="1" UnLoadOnIdle= "true" />
            </services>
          </workflowRuntime>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    
  </system.serviceModel>
  
</configuration>

請參閱

其他資源

Configuring Services Using Configuration Files
建立工作流程服務和長期服務

Footer image

Copyright © 2007 by Microsoft Corporation. All rights reserved.