我正在使用WF 4.5和Devart dotConnect(用于持久性)。我使用net.Tcp
在WorkflowServiceHost
协议中托管我的WorkflowService。我正在IncomingMessageHeaders
OperationContext.Current
发送一些信息。这一切都很好,直到我启用持久性。一旦启用了持久性,OperationContext.Current
就会获得null
。我不知道为什么会发生这种情况,OperationContext
和Persistence
中的数据都是必要的。
这是我的配置
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
可用,但只要我取消注释oracleTracking
和oracleInstanceStore
,OperationContext.Current
就会设置为空。
请帮助!!!