通过WF调用服务后,传入消息属性为null [英] Incoming Message Properties null after calling service via WF

查看:74
本文介绍了通过WF调用服务后,传入消息属性为null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我参加了所有WCF服务,其中之一就是WF服务.表示层向WF服务询问问题,然后将消息分派给其他服务.出于审核的原因,我想使用事务ID(guid)来充实我的消息,以便进行跟踪我的讯息发生了什么.但是我不想更改所有合同,所以我将交易ID(作为自定义类)放在我的soap标头中.消息检查器会在服务开始时将其剥离,并在离开服务时充实消息(在课程中实际上是客户).在所有WCF服务链中,这就像一种魅力.当我在链中引入WF服务时,我失去了在表示层中引入的向导...

我看到WF服务上的消息检查器(这是WF的接收活动)收到了guid插入了表示层.但是离开WF的调用(通过SendActivities)得到另一个向导,并且调试显示OperationContext.Current.IncomingMessageProperties等于null.

所以我认为我丢失了OperationContext,但是问题是,我怎么能维护它吗?!?!

我尝试查看ReceiveActivity的ContextToken属性,但是我认为这并不意味着出现此类问题.

有什么想法吗?如有必要,我可以发布示例解决方案.

,谢谢,

Sjarel

Hi Guys,

i'm in an all WCF soa, and one of the layers is a WF service. The presentation layer asks a question to the WF Service, and that dispatches the message to some other services.

For auditing reasons, i want to enrich my message with a transaction id (guid) so i can track what happens to my message. But i don't want to change all my contracts, so i put that transaction ID (as a custom class) in my soap header. A message inspector strips it off at the beginning of a service, and enriches the message when leaving a service (which is actually a client at that time ofcourse). In an all WCF chain of services, this works like a charm. When i introduce the WF service in the chain, i lose my guid introduced in the presentation layer...

I see that the message inspector on the WF service (which is a WF receive activity) receives the guid inserted at the presentation layer. But the calls leaving WF (via SendActivities) get another guid, and debugging shows that the OperationContext.Current.IncomingMessageProperties equals null.

So I think I lose my OperationContext, but the question is, how can I maintain it?!?!

I tried looking at the ContextToken property of the ReceiveActivity, but I think that is not meant for these kind of issues.

Any ideas? If necessary, I can post a sample solution.

Thanks,

Sjarel

推荐答案

Sjarel,

因此,对于基于工作流的WCF服务,您是否正在使用wsHttpContextBinding?由于基于WF的WCF服务将依赖于上下文(soapheader或httpcookie)在客户端和服务器之间共享上下文信息.此外,对于基于http的传输,您还可以尝试使用httpcookie传递一些数据,以查看它们是否可以从客户端流向服务并返回.

Hi Sjarel,

So for the workflow based WCF service, are you using the wsHttpContextBinding? Since WF based WCF service will rely on the Context(soapheader or httpcookie) to share context information between client and server. Also, for http based transport, you can also try using httpcookie to pass some data to see whether they can flow from client to service and return back.


这篇关于通过WF调用服务后,传入消息属性为null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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