WorkflowAuthorizationException thrown from a WebServiceInput activity terminates the workflow

Hi

I have been looking at this problem for a large part of the day and i'm completely stumped!

I have created a state machine workflow exposed as a web service. On the initial state I have an event driven activity which contains a WebServiceInput activity and a WebServiceOutput activity. This all works fine.

As an initial test on how to handle a WorkflowAuthorizationException I have set up the roles on the WebServiceInput activity to ensure that an authorization exception will be thrown. My problem is that I don't want the workflow to be terminated when a workflow authorization exception occurs. Instead I want a soap exception to be sent back to the client indicating an authorization exception and the workflow should remain at the same state. To me, this sounds like a very common requirement. Adding a WebServiceFault to a FaultHandler in the FaultHandlers for the EventDriven activity does not work.

I thought this was going to be easy... but by the end of the day i'm still pulling my hair out! Am I missing something here

Any help would be greatly appreciated.

Duncan



Answer this question

WorkflowAuthorizationException thrown from a WebServiceInput activity terminates the workflow

  • Jehan Badshah

    Hi Tom,

    Thanks for the reply, but, how will the runtime ever reach this IfElseActivity if a WorkflowAuthorizationException is thrown during processing the WebServiceInput activity The normal EventDriven sequence will exit and if not caught this will terminate the workflow.

    Duncan


  • Don Golden

    Can anyone reply to this Seriously, if i'm being dumb here please let me know, but if the only option for an authorization exception is termination of the workflow then I can't use this mechanism at all...

    Also, let me qualify my above posts with: If the workflow were a sequential workflow I could solve the problem (maybe not elegantly) by wraping the WebServiceInput in a Sequence and adding a FaultHandler that sets a flag, after the Sequence i'd add an IfElse checking this flag with a WebServiceOutput and WebServiceFault in each branch.


  • Ranier

    Marking Tom's post as answer since the discussion is continued on the following thread.

    http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=939508&SiteID=1



  • Woyler

    Instead of putting the WebServiceFault in the FaultHandler add an IfElseActivity below the WebServiceInput. Put the WebServiceFault in one branch and the WebServiceOutput in the other.

  • rayms

    Hopefully someone will get a chance to reply to me today. I would also like to add that if a web method does not return any information then you won't get notified of the workflow termination exception. Also, you can't have a WebServiceFault activity validated when configured for a WebServiceInput that has no output required, so this not sending any faults to the client is by design in this case. Which means i'm definately missing the point! Can someone educate me... Are exceptions in the workflow not meant to be reported to the caller directly
  • WorkflowAuthorizationException thrown from a WebServiceInput activity terminates the workflow