1 //---------------------------------------------------------------------
2 // This file is part of the Windows Workflow Foundation SDK Code Samples.
4 // Copyright (C) Microsoft Corporation. All rights reserved.
6 //This source code is intended only as a supplement to Microsoft
7 //Development Tools and/or on-line documentation. See these other
8 //materials for detailed information regarding Microsoft code samples.
10 //THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
11 //KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12 //IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
14 //---------------------------------------------------------------------
17 using System
.Threading
;
18 using System
.Workflow
.Runtime
;
20 namespace Microsoft
.Samples
.Workflow
.Communication
.WebService
24 static AutoResetEvent waitHandle
= new AutoResetEvent(false);
29 using (WorkflowRuntime workflowRuntime
= new WorkflowRuntime())
31 workflowRuntime
.StartRuntime();
33 workflowRuntime
.WorkflowCompleted
+= OnWorkflowCompleted
;
34 workflowRuntime
.WorkflowTerminated
+= OnWorkflowTerminated
;
36 // Load workflow type.
37 Type type
= typeof(WebServiceInvokeWorkflow
);
38 workflowRuntime
.CreateWorkflow(type
).Start();
42 workflowRuntime
.StopRuntime();
46 static void OnWorkflowCompleted(object sender
, WorkflowCompletedEventArgs e
)
51 static void OnWorkflowTerminated(object sender
, WorkflowTerminatedEventArgs e
)
53 Console
.WriteLine(e
.Exception
.Message
);