3

I'm having a problem trying to get a workflow (WF4) to call a long running WCF service and then resume processing when the WCF service completes. The diagram below gives a rough outline of what I'm trying to achieve. If you could point me at any samples that demonstrate this scenario (or something very similar) it would be greatly appreciated. For info, I've seen plenty WF to WF examples that didn't really help.

enter image description here

user321271
  • 53
  • 6

1 Answers1

0

Have you considered correlation? Is this handled for you by WF4? in WF3 this was not offered out of the box. It meant that if you sent a request out of a long running service WF3 would have no idea which instance of the workflow to route response messages to.

Without correlation the callback from WCF will not be routed to the "waiting" workflow instance.

UPDATE

Are you writing the correlation token into the callback message?

UPDATE

Sorry I don't have examples as I am not a WF4 user. I had to implement correlation into WF3 because it did not offer the feature. To do this I created a look up service which mapped correlation values to workflow instance guids, and inbound calls could then target specific instances via the wsHttpContextBinding.

But WF4 enables you to initialize and follow correlation on every send and receive-based activity. You can read about this here:

http://blogs.msdn.com/b/endpoint/archive/2010/01/04/what-s-a-correlation-and-why-do-i-want-to-initialize-it.aspx

http://msdn.microsoft.com/en-us/library/ee358755(VS.100).aspx

tom redfern
  • 30,562
  • 14
  • 91
  • 126
  • Hi Hugh, we are trying to use the Send + ReceiveReplyForSend messaging activities within a CorrelationScope container. We are hoping the CorrelationScope container activity will route the response message. – user321271 Jan 10 '12 at 15:52
  • Have updated my answer with another possibility. It would seem that they are now offering correlated solicit-response communication in WF4. – tom redfern Jan 10 '12 at 15:59
  • Hi Hugh, do you have any examples of writing the correlation token into the callback message? In the WCF service, I'm just using OperationContext.Current.GetCallbackChannel() – user321271 Jan 10 '12 at 16:35
  • Sorry I don't have any examples as I've never used it. But it sounds like this is not something which just "happens" in WF4. You need to enable it. I have updated my answer with some links. Hope they help you. – tom redfern Jan 10 '12 at 18:31
  • 1
    PS love your diagramming - what package did you use for that? – tom redfern Jan 10 '12 at 21:36
  • Hi Hugh, we used Balsamiq to create the diagram. FYI we've raised the question at MSDN forums http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/4805f1fd-9daf-460b-ae3c-fda6abe5c2b1 – user321271 Jan 12 '12 at 16:36