index > Windows Workflow Foundation > WorkflowAuthorizationException thrown from a WebServiceInput acti...

WorkflowAuthorizationException thrown from a WebServiceInput acti...

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

Duncan Stewart
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.


MS Workflow SDE/T - This posting is provided "AS IS" with no warranties, and confers no rights.
Tom Lake

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

Duncan Stewart

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.

Duncan Stewart
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?
Duncan Stewart
reply 5

You can use google to search for other answers

 

More Articles

• sequential WorkFlow
• Petri net implementation using State machine Workflow
• Problem adding a SetState Activity in a StateMachine
• Visual Studio 2005 - Workflows
• CustomActivityFramework sample and Persistence
• Go Live and June CTP?
• Obscure Error: EventDeliveryFailedException
• Configuration
• How to create and run a workflow instance.
• WF Beta 2 and February WinFX CTP Compatibility
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Design questions for payment system (tim
• ExpenseReport Sample Cancle Approval Que
• RunWorkflow from *.xoml ,*.rules?
• May the downloadable hands-on labs also
• The underlying connection was closed: An
• MSWF Persistency / How To - Step by Step
• How can an activity close itself?
• Is it ok to use User Interaction from wi
• How to use UI as part of the Workflow in
• dynamically creating workflows
• Tutorial - Lab 5 Ex 1 - votingArgs
• ASP.NET workflow sample and SqlTrackingS
• Beta 2 problems with any workflow &
• need help
• runtime

Hot Articles

• Tasklist
• ASP.NET and SqlWorkflowPersistence problem
• How can an activity close itself?
• Newbie question - Methods not available
• Persistence in Web Service
• WorkflowRuntime.CreateWorkflow overloads
• How reliable is GoLive License of WIndow
• Windows Workflow Foundation from a busin
• How can I get the type at design time of
• Activity name changing???
• workflow persistent
• PROMOTING the CUSTOM PROPERTIES Of a CUS
• SetState from Host
• Installed June CTP and now missing activ
• Recording Sequential Workflow State Chan

Recommend Articles

• Dynamic Updates/ApplyWorkflowChanges and
• Windows Workflow Foundation Guide
• SharePoint Server V3 and Windows WorkFlo
• MSDTC error when the event WorkflowIdled
• How to run wwf product?
• Beta2_2 set_up needed
• two issue for Workflow,anyone can help me.
• About the Role in WWF
• Pondering
• WWF & WCF
• State Machine Workflow with Parallel Wor
• Threading Problem with CallExternalMetho
• WorflowCompiler, rules and parameters
• DelayActivity dynamic update
• What is the best way to handle many pers