The way that WWF throws a SOAP fault exception when content based correlation is used in WWF 4 proves problematic for SOAP clients that aren’t using .NET. I have 3rd party clients who are connecting to my WWF 4 based services, and they aren’t doing to well handling the exceptions that are thrown when the content based correlation id that they use fails to correlate with a workflow instance, or when the call is made at an improper time in the instance’s workflow.
I am trying to determine the best approach to give those who are connecting to the service. One is, of course, to just tell them to catch any errors that are thrown as Fault Exceptions. However, some are connecting through off the shelf applications that are designed to make soap calls and respond to the results that are returned. Since they aren’t elegantly handling the fault exceptions, I am considering wrapping the WWF service with a WCF service that these 3rd party clients can call. In the wrapper service, I will forward their call to the WWF service and catch any correlation exceptions and return to the client an appropriate soap response instead of letting the fault exception go to the client.
I hate adding this extra service layer, and I was wondering if anyone has any suggestions or a better approach?
Is there a way to catch the correlation error in the WWF service and return a well formed response to the client?
Or, does the correlation error happen in the protocol layer of WWF and there is no way to catch that in the workflow?
These exception are a result of the WCF/WF4 interop infrastructure not being able toe determine the correct workflow instance to send the message to. The GUID mentioned is usually just a new GUID which is a bit misleading as it suggest there is a workflow instance with that ID.
The error is returned as a normal SOAP fault so any SOAP client should be able to handle the response. And being able to do anything useful with it is another matter, that is up to what the client was doing and where the correlation values send came from.