Ok. I have looked a little further and can see that WWF by default adds a HttpModule called WorkflowWebHostingModule.
I have looked at this with Reflector and can see it extracts the wf instance id from the cookie and add it like this:
HttpContext.Current.Items.Add("__WorkflowInstanceId__", new Guid(cookie1.Value));
Would it be correct to implement my own HttpModule and replace it with the default WorkflowWebHostingModule?
My new idea is to add the workflow instance id in the SOAP Header in the web service request and do something like this on every request
private void OnAcquireRequestState(object sender, EventArgs e) { string guidid = MyCustomMethodThatCanExtractMyWorkflowIdFromSoapheader();
HttpContext.Current.Items.Add("__WorkflowInstanceId__", new Guid(guidid)); }
Is this all wrong? If not. How do I extract that Workflow id in the HttpModule? Can I access it there?
Looking forward to hear from you guys.
Thanks Anders
|