1 Understanding Windows Communication Foundation and Workflow Foundation Eric Nelson Application Architect.

Slides:



Advertisements
Similar presentations
The Microsoft Technical Roadshow 2006 Windows Workflow Foundation Mike Taulty Developer & Platform Group Microsoft Ltd
Advertisements

Windows Workflow Foundation
Indigo Jonathan Turnbull Nick Cartwright Ivan Konontsev Chris Bright.
Michael S. Chan xLM Solutions, LLC
Designing, Deploying and Managing Workflow in SharePoint Sites Steve Heaney Product Development Manager OBS
Zoiner Tejada Hershey Technologies. About Zoiner Tejada.
Introduction to.NET 3.0 Henrik Westergaard Hansen Academic Developer Evangelist Developer & Platform.
.NET Framework V3.0 Mike Taulty Developer & Platform Group Microsoft Ltd
Introduction to Windows Workflow Foundation (WF) Keith Elder Microsoft MVP Blog: Quicken Loans –
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
 Introduction  WCF Definition  WCF Architecture  Implementation  WCF Demo Overview.
Windows Communication Foundation and Web Services.
The Microsoft Technical Roadshow 2006 Windows Communication Foundation Mike Taulty Developer & Platform Group Microsoft Ltd
OFC312 Developing Workflows for the 2007 Microsoft Office System and Windows SharePoint Services (version 3) Adam Calderon Principal Engineer - Interknowlogy.
Windows Vista for Syndication and Workflow Mike Ormond Developer & Platform Group, Microsoft Ltd
Web Services (ASMX 2.0 and WSE 3.0) Mike Taulty Developer & Platform Group Microsoft Ltd
Introducing Windows Workflow Foundation. Understanding Windows Workflow Foundation Janakiram MSV Developer Evangelist Microsoft Corporation Introducing.
SharePoint Collaboration Features & Workflow
Getting Started with Windows Communication Foundation 4.5 Ed Jones, MCT, MCPD, MCTS Consultant RBA Inc.
Getting Started with WCF Windows Communication Foundation 4.0 Development Chapter 1.
Using Microsoft SharePoint to Develop Workflow and Business Process Automation Ted Perrotte National Practice Manager, Quilogy, Microsoft Office SharePoint.
1 Developing Rules Driven Workflows in Windows Workflow Foundation Jurgen Willis COM318 Program Manager Microsoft Corporation.
Introduction to Windows Workflow Foundation Adam Calderon Principal Engineer - Interknowlogy Microsoft MVP – C#
Wrestling with Windows Workflow Foundation Simon Thurman Jeremy Stimson.
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Introduction to Windows Communication Foundation Ruwan Wijesinghe.
Creating Business Workflow Using SharePoint Designer 2007 Presented by Tarek Ghazali IT Technical Specialist Microsoft SQL Server MVP Microsoft SQL Server.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts How to host WCF services.
 Ed Pinto PM Microsoft Corporation. Host “Dublin”(IIS/WAS + App Server Extensions) Microsoft ®.NET Workflow Service.exe Host “Dublin”(IIS/WAS + App.
1 Understanding Windows Communication Foundation Nick Page Application Architect Microsoft Ltd.
1 Windows Communication Foundation: Integrating COM+ and MSMQ Applications Andy Milligan COM305 Program Manager Microsoft Corporation.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
CS480 Computer Science Seminar Introduction to Microsoft Solutions Framework (MSF)
VWF310: Encapsulate Custom Business Processes with Custom WF Activities Brian Noyes IDesign Inc (
Random Logic l Forum.NET l Web Services Enhancements for Microsoft.NET (WSE) Forum.NET ● October 4th, 2006.
Developing Web Services Using ASP.NET and WSE That Interoperate with the Windows Communications Foundation ("Indigo") Mark Fussell COM432 Lead Program.
James Akrigg Microsoft Ltd Integrating InfoPath Forms Into Workflow Solutions And Business Processes.
.NET Enterprise Services COM+ 1.5 麥超俊 Bobby Mak 架構技術推廣經理開發工具暨平台推廣處台灣微軟股份有限公司.
Mahesh Krishnan, Senior Consultant, Readify Slide 1.
Office Business Applications Workshop Defining Business Process and Workflows.
Telerik Software Academy Web Services & Cloud.
Kemal Baykal Rasim Ismayilov
Presentation 24: Windows Communication Foundation Introduced Objektorienteret Netværkskommunikation.
Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts How to host WCF services.
.NET Framework 3.0 Windows Presentation Foundation Windows Communication Foundation Windows Workflow Foundation.
EBIZ302 Jupiter Business Process Automation and Web Services David Fong Program Manager.
Enterprise Library Caching Application Block Peter Provost Software Design Engineer Ron Jacobs Product Manager Scott Densmore Software Design Engineer.
Dhananjay Kumar MVP-Connected System 1. WCF  Agenda What is WCF ? Why WCF? Address, Binding, Contract End Points Hosting Message Patterns Programming.
Introduction to.NET FX 3.0 (+ sneak preview of.NET FX 3.5) Martin Parry Developer & Platform Group Microsoft Ltd
The SOAP Story Martin Parry Developer & Platform Group Microsoft Ltd
Windows Communication Foundation António Cruz Freelancer (SAPO/PT.COM)
.NET Framework Enterprise. Agenda WCF Overview WCF Solutions WF Overview WF Solutions Card Spaces Bringit it all together: Dinner Now Scenario.
Workflow in Microsoft Office SharePoint Server Jessica Gruber Consultant Microsoft Corporation.
Shani Raba Team Leader & Software Architect
A Web Service Software Factory Introduction Don Smith Product Manager patterns & practices.
Windows Workflow Foundation Guy Burstein Senior Consultant Advantech – Microsoft Division
BizTalk Damir Dobric Lead Architect. Agenda Microsoft BizTalk RFID Overview Architecture Application models Implementing Event Handlers Sensors.
Windows Communication Foundation and Web Services
Introducing the Microsoft® .NET Framework
Välkommen till Sommarkollo 2006
COM210 Introduction to Workflow in Windows Applications
Windows Communication Foundation (WCF)
Windows Communication Foundation and Web Services
Windows Communication Foundation
Building event-driven, long-running apps with Windows workflow
Introduction to Windows Workflow Foundation (WF)
Windows Communication Foundation (WCF)
The SOAP Story Martin Parry Developer & Platform Group Microsoft Ltd
Mark Quirk Head of Technology Developer & Platform Group
Presentation transcript:

1 Understanding Windows Communication Foundation and Workflow Foundation Eric Nelson Application Architect Microsoft Ltd

2 Windows Communication Foundation

3 Agenda Why another way to do A to B Basic Principles of WCF Creating a Service

4 Challenges How do I ensure reliable connectivity? How do I support rich authentication types? How do I ensure interoperability with other platforms? How do I make my distributed applications less fragile? How do I make them “service- oriented?” Which programming model should I use?

5 Where Are We Today? Remoting ASMX / WSE DCOM System.Messaging Enterprise Services Microsoft Sockets RMI JAX-RPC CORBA JMS EJB J2EE Sockets

6 Side-by-side co-existence with existing distributed technologies Seamless communication with applications built on existing technologies Smooth upgrade of existing code to WCF Investment Protection Leveraging Existing Microsoft Investments ASMX ASMX ASMXESWSE3

7 using System.Web.Services; public class AccountingOperation { public string AccountName; public long Amount; } public class Accounting { [WebMethod(TransactionOption=TransactionOption.RequiresNew)] public int AddEntry(AccountingOperation debit, AccountingOperation credit) { // Add entry to internal accounting book // return id. } } using System.ServiceModel; [ServiceContract(FormatMode=ContractFormatMode.XmlSerializer)] [OperationContract] [OperationBehavior(AutoEnlistTransaction=true)] // ASMX to WCF

8 Basic Principles  Clients and Services  Endpoints  A, B, C  Behaviors

9 Client Service Clients and Services

10 Client Service Endpoints Endpoint

11 Client Service Address, Binding, Contract CBA CBA CBA A BC Address Where? Contract What? Binding How?

12 Client Service Behaviors CBA CBA CBA A BC B B B

13 Selecting… AddressBinding BehaviorContract HTTP Transport TCPTransport NamedPipe Transport MSMQ Transport Custom Transport WS-Security Protocol WS-RM Protocol WS-Coord Protocol Duplex Channel Custom Protocol net.tcp://... net.pipe://... net.msmq://... xxx://... ThrottlingBehavior Metadata Behavior Error Behavior Custom Behavior Instancing Behavior Concurrency Behavior Transaction Behavior Security Behavior Request/ Response One-Way Duplex net.p2p://... PeerTransport Externally visible, per-endpoint Opaque, per-service, endpoint, or operation

14 Creating a Service  Define What to Expose (Contract)  Implement Contract  Define Endpoint(s)  Define How to Expose (Binding)  Define Where to Expose (Address)  Host & Run Service

15 C ontracts A Service is a CLR Class that Implements One or More Service Contracts [DataContract] public class OrderDetail { [DataMember] public string ItemName { get; set; } [DataMember] public Guid ItemId { get; set; } [DataMember] public double ItemPrice { get; set; } } [ServiceContract] public interface IOrderProcessingService { [OperationContract(IsOneWay = true)] void ProcessOrder(OrderDetail detail); } class OrderProcessingService : IOrderProcessingService { public void ProcessOrder(OrderDetail detail) {... } } [DataContract] public class OrderDetail { [DataMember] public string ItemName { get; set; } [DataMember] public Guid ItemId { get; set; } [DataMember] public double ItemPrice { get; set; } } [ServiceContract] public interface IOrderProcessingService { [OperationContract(IsOneWay = true)] void ProcessOrder(OrderDetail detail); } class OrderProcessingService : IOrderProcessingService { public void ProcessOrder(OrderDetail detail) {... } }

16 Encoding Text, Binary, MTOM, Custom Transport Selection TCP, HTTP, Named Pipes, Peer Channel, MSMQ, Custom End-to-End Security Confidentiality, Integrity, AuthN, AuthZ, Federation & Infocard X.509, Username/Password, Kerberos, SAML, XrML, Custom End-to-End Reliable Messaging Transport-Independent QoS (In-Order / Exactly-Once) Volatile and Durable Queues for Availability Transactions Shared Transactions for “Synchronous” Operations Transactional Queues for “Asynchronous” Operations B inding

17 A ddresses Scheme http, https, net.tcp, net.pipe Host Name microsoft.com Port (Optional) * 80, 443, 808 Base Path /OrderService/ Endpoint Address WS, BP, TCP, NP * - Port Does Not Apply to Named Pipes

18 Hosting ServiceHost allows for hosting anywhere Console applications Windows applications Windows services IIS provides an enterprise class hosting environment Edit a.svc file and point at your service HTTP transport in IIS 6.0 All transports in IIS 7.0 (Windows Activation Service)

19 ServiceHost Allows a WCF Service to be Hosted in Any AppDomain EXE, NT Service, WinForms, Avalon, etc. public static void Main(string[] args) { ServiceHost host = new ServiceHost( typeof(OrderProcessingService); host.BaseAddresses.Add( new Uri(“ host.Open(); } public static void Main(string[] args) { ServiceHost host = new ServiceHost( typeof(OrderProcessingService); host.BaseAddresses.Add( new Uri(“ host.Open(); }

20 Windows Communication Foundation Svctraceviewer.exeSvcconfigeditor.exe + so much more

21 Windows Workflow Foundation

22 Agenda Introduction to Windows Workflow Foundation Workflow basics Activities basics

23 Windows Workflow Foundation Windows Workflow Foundation is the programming model, engine and tools for quickly building workflow enabled applications on Windows. Single workflow technology for Windows Available to all customers of Windows Available for use across a broad range of scenarios Redefining workflow Extensible framework & API to build workflow centric products One technology for human and system workflow Take workflow mainstream Incremental learning for mainstream.NET developer Fundamental part of Office 2007 Strong workflow partner & solution ecosystem

24.NET Framework 3.0 Workflow and BizTalk Server Windows Workflow Foundation Messaging DesignTools BusinessActivityMonitorAndAdminTools Orchestration Transformation Adapters BizTalk Server Accelerators Premium BPM server Premium BPM server Application to application and B2B integrationApplication to application and B2B integration Connects multiple services built with WCFConnects multiple services built with WCF Adapters to multiple products like SAP and MQSeriesAdapters to multiple products like SAP and MQSeries Business activity monitoringBusiness activity monitoring Vertical solutions and industry acceleratorsVertical solutions and industry accelerators Message transformation servicesMessage transformation services Enterprise single sign-onEnterprise single sign-on End-to-end health and activity trackingEnd-to-end health and activity tracking And more…And more… Workflow framework Workflow framework Exposed via.NET 3.0 Exposed via.NET 3.0 Broad set of scenarios Broad set of scenarios Used to build solutions Used to build solutions Enables manageability Enables manageability and scale-out in solutions Use for building workflow into apps or workflow-enabled servers Use for building workflow into apps or workflow-enabled servers Visual Studio Designer Workflow

25 What is a workflow? A set of activities that coordinate people and / or software... EscalateToManager Example activities…. CheckInventory Like a flowchart…. …organized into a workflow. Or a state diagram….

26 Why Workflow Technology? Long running and stateful behavior Transparency Flexible control flow Developer Productivity Workflows technology provides abstractions convenient to describe real world workflows Workflow Technology Value-Add

27 Why Workflow Technology? “Orders are confirmed in 48 hours and shipped within 30 days.” “Most suppliers confirm our orders but some forget and we need to followup.” “What are the next steps in handling this order?” Long Running and Stateful Workflows run for up to 30 days and maintain state throughout Flexible Control Flow Flexibility for people to override or skip steps in the workflow Transparency Rendering a visualization of next steps based on defined control flow Real World Examples Workflow Value-Add

28 Windows Workflow Foundation Key Concepts Host Process Windows Workflow Foundation Runtime Engine A Workflow An Activity Runtime Services Base Activity Library Custom Activity Library Visual Designer Visual Designer: Graphical and code- based construction Workflows are a set of Activities Workflows run within a Host Process: any application or server Developers can build their own Custom Activity Libraries Components Base Activity Library: Out-of-box activities and base for custom activities Runtime Engine: Workflow execution and state management Runtime Services: Hosting flexibility and communication

29 Workflow Basics A workflow is a class A workflow class may be defined in markup … using System.Workflow.Activities; public class Workflow1 : SequentialWorkflow { }

30 Workflow Basics Workflow constructor configures contained activities (like forms & controls) using System.Workflow.Activities; public partial class Workflow1 : SequentialWorkflow { public Workflow1() { InitializeComponent(); } public sealed partial class Workflow1 : SequentialWorkflow { private Delay delay1; private void InitializeComponent() { this.delay1 = new System.Workflow.Activities.Delay(); this.delay1.ID = “delay1"; this.delay1.TimeoutDuration = System.TimeSpan.Parse("00:00:05"); this.Activities.Add(this.delay1); this.ID = "Workflow1"; }

31 Workflow Authoring Modes.NET assembly ctor defines workflow Markup Only “Declarative” XAML Markup and Code C#/VB Code Only ApplicationGenerated XAML C#/VB XML defines XML defines workflow structure logic and data flow XML defines XML definesworkflow Code-beside Code-beside defines extra logic Code creates Code createsworkflow in constructor XAML C#/VB App creates activity tree and serializes Workflow Compiler wfc.exe C#/VB Compiler

32 Workflows

33 Activity Basics An activity is a step in a workflow Unit of execution, re-use and composition Think of Forms & Controls Activity == Controls Workflows == Forms Activities fall under two broad categories Basic – steps that “do work” Composite – manage a set of child activities Activities are classes Have properties and events that are programmable within your workflow code Have methods (e.g. Execute) that are only invoked by the workflow runtime

34 Example: A SendMail Activity using System.Workflow.ComponentModel; public partial class SendMail : System.Workflow.ComponentModel.Activity { public SendMail() { InitializeComponent(); } protected override Status Execute(ActivityExecutionContext context) { // my logic here to send the return Status.Closed; } public partial class SendMail { public string subject; public string Subject { get { return subject; } set { this.subject = value; } } private void InitializeComponent() // designer generated { this.ID = "SendMail"; }

35 Activities: An Extensible Approach OOB activities, workflow types, base types base typesGeneral-purpose Activity libraries define workflow define workflow constructs constructs Create/Extend/ Compose activities App-specific building blocks First-class citizens Base Activity Library Custom Activity Libraries Author new activity Out-of-Box Activities Extend activity Compose activities Vertical-specific activities & workflows Best-practice IP & Knowledge Domain-Specific Workflow Packages Compliance RosettaNet CRM IT Mgmt

36 Combining WCF and WF

37 Coordinating Services Workflows are an excellent way to coordinate work across multiple services Service interaction is modeled using activities in a workflow Service interaction can be visualized Data can be flowed from one activity and service to another Workflows simplify asynchronous service calls and complex message exchange patterns Parallel execution, delays, time-outs, etc. Service interaction can easily be modified and dynamically changed Coordinating Services

38 Implementing Services using Workflow Challenges developing services today Services are often used together as part of a business process, but are not explicitly associated Services often front-end, long-running business processes Workflows are an excellent way to implement the logic behind services State management across multiple service interactions Services are associated together in a workflow model Implementation of services can be transparent Enables visibility into the state of the service Configurable runtime behavior Tracking, persistence, transactions, threading, etc. Workflows exposed through services

39 The Workflow/Service Ecosystem Solutions will often combine both approaches Workflow

40 Call To Action WCF is “no brainer” for future connectivity Use it Don’t necessarily need to port to it Use WF Build workflow into your applications Make you applications more flexible and configurable Build workflow enabled servers for other developers to target Build custom activity libraries for others to re-use Build solutions on top of workflow enabled products like Office 2007

41 Resources MSDN® ommunication/ ommunication/ Community Site Subscribe to the RSS feed for news & updates Find, download, & register Activities Find blogs, screencasts, whitepapers, and other resources Download samples, tools, and runtime service components

42 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

43 WCF Code Migration

44 using System.Web.Services; public class AccountingOperation { public string AccountName; public long Amount; } public class Accounting { [WebMethod(TransactionOption=TransactionOption.RequiresNew)] public int AddEntry(AccountingOperation debit, AccountingOperation credit) { // Add entry to internal accounting book // return id. } } using System.ServiceModel; [ServiceContract(FormatMode=ContractFormatMode.XmlSerializer)] [OperationContract] [OperationBehavior(AutoEnlistTransaction=true)] // ASMX to WCF

45 public class Accounting : ServicedComponent { public void AddCreditEntry(string creditAccount, int creditAmount) { } using System.EnterpriseServices; [ComponentAccessControl] [SecureMethod] [Transaction(TransactionOption.Required)] [SecurityRole("Manager")] using System.ServiceModel; [ServiceContract] [OperationContract] [OperationBehavior(AutoEnlistTransaction=true)] [PrincipalPermission(SecurityAction.Demand, Role="Managers")] // Enterprise Services to WCF

46 using Microsoft.Web.Services3; [WebService] class HelloWorld { [WebMethod] public string Hello (string text) { MessageSignature signature = (MessageSignature) RequestSoapContext.Current.Security.Elements[0]; if (!signature.SigningToken.Principal.IsInRole ("BUILTIN\Administrators")) throw new AuthorizationException("Access denied"); return String.Format("Hello, {0}", text); } } Note: Configuration entry changes are required [OperationContract] [PrincipalPermission(SecurityAction.Demand, null, "BUILTIN\Administrators")] using System.ServiceModel; [ServiceContract] // // // // // // // // WSE to WCF

47 class MyQService { public void ReceiveOrders() { MessageQueue Queue = new XmlMessageFormatter formatter = new XmlMessageFormatter( new Type[] { typeof(System.Data.DataSet)}); Queue.Formatter = formatter; System.Messaging.Message msg = null; while((msg= Queue.Receive()) != null) { DataSet booklist = (DataSet) msg.Body; ProcessOrders(booklist); } } Public void ProcessOrder(DataSet BookList) {... } } using System.Messaging; using System.ServiceModel; [ServiceContract] [OperationContract(IsOneWay = true)] // // // // // // // // // // // // // System.Messaging to WCF

48 using System.Runtime.Remoting; [Serializable] public class AccountingOperation { public string AccountName; public long Amount; } public class Accounting { public int AddEntry(AccountingOperation debit, AccountingOperation credit) { // Add entry to internal accounting book // return id. } } using System.ServiceModel; [ServiceContract] [OperationContract] : MarshalByRefObject //.NET Remoting to WCF