Behind Workflow *ContextBinding protocol

Damir Dobric Posts

Next talks:

 

    

Follow me on Twitter: #ddobric



 

 

Archives

WF Services introduce few new bindings which slightly change the communication protocol between client and service.
This post contains one full message exchange example of the statemachine-workflow which provide
two operations: GetData and OnNewMessage.

The first operation starts the workflow and the second one should fire event in the
statemachine-workflow.Following picture shows the statemachine-workflow service and
pictures below show the initial state initiated by invoking of operation GetData()
and the state OnNextMessage which is triggered by invoking of
the operation OnNextMessage() respectively.

image

- Workflow used in this example -

image

- Initial Worflow State which is activated by invoking of GetData() -

image

- Behind of OnNextMessage state which is activated by invoking of OnNextMessage()-


This is the code which starts the workflow:


image 

   Following message is sent from client to service while invoking the operation string GetData(int):

image

After invoking of this operation the response is returned back. However this response
contains the cookie value which describes the workflow context:

image

This value is required by each next operation invocation to identify the workflow
instance which will receive the message. The first message above has not
workflow context value, because the workflow does not exist at the moment
of invocation. After the workflow instance is created the workflow context is retrieved.
The retrieved value uniquely identifies the workflow instance.

In the next example we invoke the second operation (OnNextMessage) on the same client
proxy instance.

image

This call produces following message sent form the client to the service:

image
As we see, the workflow context identifier is appended in the web-header. This value will be used
on the service side to identify the target WF instance and to invoke the operation
OnNextMessage on that instance. Here is the response of invocation:
image

Note that this response does not contain the context identifier value header "WscContext".


Posted Mar 07 2008, 10:10 PM by Damir Dobric
Filed under: ,

Comments

Damir Dobric Posts wrote Exception while obtaining of ContextManager
on 03-29-2008 15:06

While implementing of correlation in Workflow Service based on *HttpContextBindig , you may get following

Damir Dobric Posts wrote Workflow Services: ContextManager is NULL-reference
on 04-22-2008 14:41

When using ContextManager in WorflowService scenario, it can happen that the instance of the manager

developers.de is a .Net Community Blog powered by daenet GmbH.