启用工作流持久性时,OperationContext.Current变为null

时间:2015-04-17 09:27:01

标签: c# wcf workflowservice workflow-foundation-4.5

我正在使用WF 4.5和Devart dotConnect(用于持久性)。我使用net.TcpWorkflowServiceHost协议中托管我的WorkflowService。我正在IncomingMessageHeaders OperationContext.Current发送一些信息。这一切都很好,直到我启用持久性。一旦启用了持久性,OperationContext.Current就会获得null。我不知道为什么会发生这种情况,OperationContextPersistence中的数据都是必要的。 这是我的配置

Behaviors.config:

<behaviors>
  <endpointBehaviors>
    <behavior name="ParametersInHeaderBehaviour">
      <HeaderExtension />
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="WorkflowService_Behavior">
      <!--<workflowServiceTrace />-->
      <!--<serviceMetadata httpGetEnabled="true" />-->
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceAuthorization principalPermissionMode="Custom" serviceAuthorizationManagerType="Capita.Prism.Authorization.Foundation.Managers.UserAuthorizationManager, Capita.Prism.Authorization.Foundation, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null">
        <authorizationPolicies>
          <add policyType="Authorization.Foundation.ADMappingPolicy, Authorization.Foundation, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" />
        </authorizationPolicies>
      </serviceAuthorization>
      <!--<oracleTracking connectionString="User Id=workflow;Password=oracle;Server=DEVDB;" profileName="Sample Tracking Profile"/>
      <oracleInstanceStore connectionString="User Id=workflow;Password=oracle;Server=DEVDB;" instanceEncodingOption="None" instanceCompletionAction="DeleteNothing" instanceLockedExceptionAction="NoRetry" hostLockRenewalPeriod="00:00:30" runnableInstancesDetectionPeriod="00:00:05"/>-->
      <workflowIdle timeToUnload="0"/>
      <workflowUnhandledException action="AbandonAndSuspend"/>
      <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
    </behavior>
  </serviceBehaviors>
</behaviors>

使用此行为OperationContext.Current可用,但只要我取消注释oracleTrackingoracleInstanceStoreOperationContext.Current就会设置为空。

请帮助!!!

0 个答案:

没有答案