Fault handling with WCF activities

Topics: Developer Forum
Jun 16, 2007 at 8:40 AM
Hi Marcel,

Thank you for providing this code! I've been struggling with some limitations with asmx web services in general but could not look at WCF because workflow activities for this are still some time away from Microsoft.

One big difference I notice with your activities as appose to the asmx ones are you have no WebServiceFault equivalent? I have been struggling to understand how best to handle returning faults without terminating the workflow for example if there was an authorization problem or database constraint violation or the like during the operation between the input and output activities.

How would you suggest handling these situations with your activities?

Sep 5, 2007 at 7:33 PM
Fisrt of all sorry for this very late reply. I always forget to check the discussion list and I don't reciev mail when something is posted :-(

In the case of authorization the best way to do this is probably just using the WCF AuthoriationService class that you can implement yourself and add that to the service configuration. this way tthe message is never dispatched to the WCF stack in the workflow and therefore you will not be bothered with terminated workflows if you would throw an exception.

I do agree that a fault activity might be a nice thing to look into, I never needed it myself because I always use the service implemetnation pattern Message in - Messgae out where the out message contains the information that authorization failed. So I handle the exceptions in the code and return the information in the return message, not using Soap Faults.

If I can find some time I will see if I can create such a Fault activity as well.
thanks for the feedback,