"CorrelationResponse上下文不应为空".在窗口工作流程4.0中 [英] "CorrelationResponse context should not be null" in window workflow 4.0

查看:79
本文介绍了"CorrelationResponse上下文不应为空".在窗口工作流程4.0中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发具有多个接收项的Windows工作流4服务.我正在处理所有异常,并且服务没有抛出任何未处理的异常.我有两个回复活动,一个发送一个faultException,另一个发送 实际答复.

I am developing a windows workflow 4 service that has multiple receives. I am handling all the exceptions and there isnt any unhandled exception thrown by the service. I have two reply activities one that sends a faultException and the other that sends the actual reply.

在第一个接收活动上,我接收到响应,但是在第二个接收活动上,如果存在异常,则返回错误,但对第二个接收的任何后续请求都将抛出

on the first receive activity i receive the response but on the second one if there is an exception, the fault is returned but any subsequent request to the second receive throws a

因为实例处于挂起状态,所以无法执行该操作.

如果我通过Windows Appfabric仪表板检查跟踪,则工作流实际上已暂停,并出现以下错误

If i check the tracking through windows appfabric dashboard the workflow is actually suspended with the following error

CorrelationResponse上下文不应为null.这可能是因为相关句柄未正确设置.

CorrelationInitializers中没有回复活动,我真的不希望工作流挂起并接收其他请求.

There is nothing in the CorrelationInitializers on the reply activities and I dont really want the workflow to suspend and to receive additional requests.

有什么想法吗?

谢谢,瓦希德(Waheed)

Thanks, Waheed

推荐答案

SendReply活动使用Correlation句柄与创建它的Receive活动相关联.相关句柄未正确设置.

The SendReply activity uses a Correlation handle to correlate to the Receive activity that created it. Somehow the correlation handle is not setup properly.

WCF/WF服务故障和验证示例 我创建了一个返回故障异常的工作流服务.您可以在XAML下方看到如何设置RequestReplyCorrelationInitializer.确保您的代码具有相似的内容.

In the WCF / WF Service Fault and Validation Example I have created a Workflow Service that returns a Fault Exception.  You can see the in the XAML below how the RequestReplyCorrelationInitializer is setup.  Make sure your code has something similar.


<Receive x:Name="__ReferenceID2" CanCreateInstance="True" DisplayName="ReceiveRequest" sap:VirtualizedContainerService.HintSize="255,90" OperationName="GetDataWithArgValidation" ServiceContractName="p:IWfService">
 <Receive.CorrelationInitializers>
  <RequestReplyCorrelationInitializer CorrelationHandle="[handle]" />
 </Receive.CorrelationInitializers>
 <ReceiveMessageContent>
  <p1:OutArgument x:TypeArguments="swc:GetDataRequest">[request]</p1:OutArgument>
 </ReceiveMessageContent>
</Receive>
<SendReply Request="{x:Reference __ReferenceID2}" DisplayName="SendResponse" sap:VirtualizedContainerService.HintSize="255,90">
 <SendMessageContent>
  <p1:InArgument x:TypeArguments="x:String">["Data: " + request.Foo.Data.ToString()]</p1:InArgument>
 </SendMessageContent>
</SendReply>
<SendReply Request="{x:Reference __ReferenceID2}" DisplayName="Send (generates FaultContract)" sap:VirtualizedContainerService.HintSize="255,90">
 <SendMessageContent>
  <p1:InArgument x:TypeArguments="FaultException(swc:ArgumentValidationFault)">[New FaultException(Of ArgumentValidationFault)(New ArgumentValidationFault())]</p1:InArgument>
 </SendMessageContent>
</SendReply>


这篇关于"CorrelationResponse上下文不应为空".在窗口工作流程4.0中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆