Building Connected
 Application using WF and
 WCF
Sarang Datye
sarang.datye@microsoft.com
http://www.dotnetbetaworks.com
Agenda
 Modeling processes via WF
 Exposing and consuming services via WCF
What is Workflow?
The workflow framework and tools for
       Microsoft products and
    partner/customer ecosystem

 Sing...
Why Workflow?
                              Workflow Value-Add
 Real-World Examples

                            Long Runn...
Architecture                                   Visual Designer

Key Concepts
                                             ...
Extensible Activities                                 Domain-Specific
                            Custom Activity
Base Act...
Runtime Extensibility
                        Host App Domain
                        Runtime

                           ...
Workflow Services
Advantages
  Service implemented as Workflow
     Leverage Workflow development experience
     Enforces...
Workflow Service
Architecture
Service.cs
Workflow.cs or
Workflow.xoml
                                                    ...
Getting Started with WF
Agenda
 Modeling processes via WF
 Exposing and consuming services via WCF
The Imperative to Connect
MOBILE EMPLOYEES   CUSTOMERS   CUSTOMERS   MOBILE EMPLOYEES
WCF is:
 Our next-generation platform for distributed systems
 A set of extensions to the Microsoft.NET Framework 2.0
 Bui...
Benefits of WCF
                   Unifies today’s distributed technologies
  Unification      Lets you develop/deploy/man...
Unified Programming Model


                                        .NET Remoting
   ASMX & WSE

       Interop           ...
A Look at WCF (1)


  Client                      Service
                          Endpoint

                Message
    ...
A Look at WCF (2)


  Client                                             Service
                                         ...
Productivity
Using Visual Studio .NET 2003


 class HelloService {

                                                      ...
Productivity
Using Visual Studio .NET 2003 and WSE


   class HelloService {

       [WebMethod]
       public String Hell...
Productivity 2005 and WCF
   Using Visual Studio

[ServiceContract]
class HelloService
{
  [OperationContract]
           ...
Getting Started with
WCF
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be...
Questions…
Upcoming SlideShare
Loading in …5
×

Connected Applications using WF and WCF

3,842 views

Published on

Connected Applications using WF and WCF

Published in: Technology
  • Be the first to comment

Connected Applications using WF and WCF

  1. 1. Building Connected Application using WF and WCF Sarang Datye sarang.datye@microsoft.com http://www.dotnetbetaworks.com
  2. 2. Agenda Modeling processes via WF Exposing and consuming services via WCF
  3. 3. What is Workflow? The workflow framework and tools for Microsoft products and partner/customer ecosystem Single workflow technology for Microsoft® Windows® A framework for building workflow, not an application or server Make declarative workflow a mainstream development paradigm
  4. 4. Why Workflow? Workflow Value-Add Real-World Examples Long Running and Stateful “Orders are confirmed in Workflows run for up to 30 48 hours and shipped days and maintain state within 30 days.” throughout “Most suppliers Flexible Control Flow confirm our orders but Flexibility for people to some forget and we override or skip steps in need to follow up.” the workflow Transparency “What are the next steps Rendering a visualization of in handling this order?” next steps based on defined control flow
  5. 5. Architecture Visual Designer Key Concepts A Workflow Workflows are a set of Activities Workflows run within a Host Process: any application or server An Activity Developers can build their own Custom Activity Libraries Custom Activity Library Windows Components Workflow Foundation Base Activity Library: Out-of-box activities Base Activity Library and base for custom activities Runtime Engine: Workflow execution and Runtime Engine state management Runtime Services: Hosting flexibility and Runtime Services communication Visual Designer: Graphical and code- Host Process based construction
  6. 6. Extensible Activities Domain-Specific Custom Activity Base Activity Workflow Packages Libraries Library Compliance CRM Extend Compose activity activities Out-of-Box RosettaNet (OOB) Activities Author new activity IT Mgmt OOB activities, workflow Create/Extend/ types, Vertical-specific activities Compose activities base types and workflows App-specific building General-purpose Best-practice intellectual blocks Activity libraries property (IP) and First-class citizens define workflow knowledge constructs
  7. 7. Runtime Extensibility Host App Domain Runtime Out of Box Services are provided that support SQL Services Server 2000 & 2005 PersistenceService stores and retrieves PersistenceService SQL instance state. TrackingService TrackingService manages profiles and SchedulerService stores tracked information. TransactionService Common resource services for managing threading, timers and creating transactions
  8. 8. Workflow Services Advantages Service implemented as Workflow Leverage Workflow development experience Enforces application protocol by default Allows long-running, durable Services Workflow hosted as Service ServiceContract provides typed interface for integrating with the Workflow Messages enforce by-value, serializable data Workflows can be message-activated
  9. 9. Workflow Service Architecture Service.cs Workflow.cs or Workflow.xoml Service Instance Workflow Instance Service Runtime OperationInvoker Operation 1 ReceiveActivity 1 WorkflowOperationInvoker App.config OperationSelector Operation 2 ReceiveActivity 2 Workflow ServiceHost ServiceHost InstanceProvider DurableInstanceProvider Workflow Runtime MessageInspector MessageContextInspector ServiceDescription ContextChannel WF Persistence DB ServiceBehavior WorkflowServiceBehavior ListenerChannel OperationBehavior WorkflowOperationBehavior
  10. 10. Getting Started with WF
  11. 11. Agenda Modeling processes via WF Exposing and consuming services via WCF
  12. 12. The Imperative to Connect MOBILE EMPLOYEES CUSTOMERS CUSTOMERS MOBILE EMPLOYEES
  13. 13. WCF is: Our next-generation platform for distributed systems A set of extensions to the Microsoft.NET Framework 2.0 Build WCF services in Visual Studio 2008 using any .NET Language Intelligent code editing, IDE Extensions for WCF, debugging, re-factoring, code snippets, etc. Visual Basic .NET, Visual C#, etc. Runs on Microsoft Windows Vista Microsoft Windows XP Microsoft Windows Server 2003 Part of .NET 3.0 and .NET 3.5
  14. 14. Benefits of WCF Unifies today’s distributed technologies Unification Lets you develop/deploy/manage one model Visual Studio 2008 integration Broad support for Web services Interoperability (WS-*) specifications and REST Single stop shop for building services Enables development of Service-Oriented loosely-coupled services Development Config-based communication
  15. 15. Unified Programming Model .NET Remoting ASMX & WSE Interop Extensibility with other Location transparency Platforms & WS-* Attribute- Message- Based Oriented REST / HTTP Programming Programming Programming Enterprise System.Messaging Services HTTP Services
  16. 16. A Look at WCF (1) Client Service Endpoint Message Endpoint Endpoint
  17. 17. A Look at WCF (2) Client Service A B C Message C B A A B C Address Binding Contract (Where) (How) (What)
  18. 18. Productivity Using Visual Studio .NET 2003 class HelloService { 20,379 lines [WebMethod] security public String Hello(String Greeting) { X509CertificateCollection collection = new X509CertificateCollection(); 5,988 lines IntPtr blob = Marshal.AllocHGlobal(Marshal.SizeOf( reliable messaging typeof(CRYPTOAPI_BLOB))); IntPtr data = (IntPtr)((int)blob + Marshal.SizeOf(typeof(CRYPTOAPI_BLOB))); … 25,507 lines transactions SeqAckRange range = new SeqAcknRange(id, low, high ); SeqAckRange[] ranges = { range }; ReliableQueue.ProcessAcks( ranges ); … 4,442 lines infrastructure BeginTransaction (NULL, ISOLATIONLEVEL_SERIALIZABLE, 0, pITxOptions, &pITransaction); … Total lines 56,296 return Greeting; } }
  19. 19. Productivity Using Visual Studio .NET 2003 and WSE class HelloService { [WebMethod] public String Hello(String Greeting) { 10 lines foreach ( SecurityToken tok in security requestContext.Security.Tokens { X509SecurityToken token = tok as X509SecToken 1,804 lines } reliable messaging … SeqAckRange range = new SeqAcknRange(id,low,high ); SeqAckRange[] ranges = { range }; 25,507 lines ReliableQueue.ProcessAcks( ranges ); transactions … BeginTransaction (NULL, ISOLATIONLEVEL_SERIALIZABLE, 0, pITxOptions, Total lines 27,321 &pITransaction); … return Greeting; } }
  20. 20. Productivity 2005 and WCF Using Visual Studio [ServiceContract] class HelloService { [OperationContract] 1 code + 2 config (elem.) [PrincipalPermission(SecurityAction.Demand, Role = “Adminstratorsquot;)] security [TransactionFlow(TransactionFlowOption.Mandatory)] [OperationBehavior(TransactionScopeRequired = true, 0 code + 1 config (elem.) TransactionAutoComplete = true)] String Hello(String Greeting) {return Greeting;} reliable messaging } <bindings> 2 code + 1 config (attr.) <wsHttpBinding> transactions <binding name=quot;Binding1“ transactionFlow=quot;truequot;> <security mode=quot;Messagequot;> <message clientCredentialType=quot;Windows“/> Total lines: </security> 3 code (what) + 4 config (how) <reliableSession enabled=quot;truequot; /> </binding> </wsHttpBinding> </bindings>
  21. 21. Getting Started with WCF
  22. 22. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  23. 23. Questions…

×