var318: developing service oriented workflows brian noyes idesign inc () [email protected]

23
VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc ( www.idesign.net ) [email protected]

Post on 19-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

VAR318: Developing Service Oriented Workflows

Brian Noyes

IDesign Inc (www.idesign.net)

[email protected]

Page 2: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

About Brian

• Chief Architect, IDesign Inc. (www.idesign.net) • Microsoft Regional Director / MVP• Publishing

● Developing Applications with Windows Workflow Foundation, LiveLessons training DVD, June 2007.

● Smart Client Deployment with ClickOnce, Addison Wesley, January 2007

● Data Binding in Windows Forms 2.0, Addison Wesley, January 2006● MSDN Magazine, MSDN Online, CoDe Magazine, The Server

Side .NET, asp.netPRO, Visual Studio Magazine• Speaking

● Microsoft TechEd US, Europe, Malaysia, Visual Studio Connections, DevTeach, INETA Speakers Bureau, MSDN Webcasts

• Participates in Microsoft Design Reviews• E-mail: [email protected]• Blog: http://briannoyes.net

Page 3: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

Agenda

• SOA Overview• WF Service Capabilities• Exposing WF Workflows as Services• Consuming Services from Workflows

Page 4: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

SOA Overview

• Service Orientation is a way of building composite applications

• A service is a composable unit of processing and data exposed to consumers

• A further abstraction from objects or components

Page 5: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

SOA Tenets

• Service boundaries are explicit

• Services are autonomous

• Services share schema and contract, not type

• Services are compatible based on policy

5

Page 6: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

Loan Application Process

Workflow as Orchestration

Exchange SQL DB SQL DB

Page 7: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

Workflow as Service Operation

Transfer Money

DebitManager

CreditManager

AuthorizationManager

Loan Application Process

FundManager

Page 8: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

Agenda

• SOA Overview• WF Service Capabilities• Exposing WF Workflows as Services• Consuming Services from Workflows

Page 9: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

WF Service Capabilities

• WF leverages WCF’s ability to define, expose, and call services● Interoperable● Extensible● Productive ● Complies with SOA tenets

Page 10: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

WF Service Capabilities

• WF can expose workflows as services● Activities as service operation implementation● ReceiveActivity

• WF Workflows can be clients to services● SendActivity● Custom activity encapsulating a proxy

Page 11: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

WF Service Capabilities

• WF/WCF supply supporting bindings and hosting capabilities to make it easy to expose the WF service capabilities● Bindings

• BasicHttpContextBinding• NetTcpContextBinding• WSHttpContextBinding

● WorkflowServiceHost

Page 12: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

Agenda

• SOA Overview• WF Service Capabilities• Exposing WF Workflows as Services• Consuming Services from Workflows

Page 13: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

Exposing Workflows as Services

• Add ReceiveActivity to workflow● Set service contract/method properties● Bind input parameters / return values

• Create host application● WorkflowServiceHost – self hosted● WorkflowServiceHostFactory – IIS hosted

• Use Workflow compatible bindings● NetTcpContextBinding● BasicHttpContextBinding● WSHttpContextBinding

Page 14: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

Context Bindings

• Round trip workflow instance ID in custom header● Similar to cookie passing in a browser

• Uses WCF contexts to store header info• Not required to call workflow services, but

makes it much easier● Automatic routing by workflow runtime to

target workflow instance

Page 15: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

Multiple Clients per Workflow

• Will need to extract instanceID from message headers● Proxy inner channel context manager

Page 16: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

16

Exposing Workflow Services

Brian NoyesChief ArchitectIDesign Inc (www.idesign.net)

claireh
NOTE TO SPEAKERS: Demo failure is the #1 cause of low scores. Increase speed and reliability by using the virtual demo. For detailed information, consult the Virtual Demo tab of the speaker portal (www.msteched.com).
Page 17: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

Agenda

• SOA Overview• WF Service Capabilities• Exposing WF Workflows as Services• Consuming Services from Workflows

Page 18: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

Consuming Services from Workflows

• SendActivity acts as a WCF proxy

• Needs service contract interface that it will be calling

• Needs proxy configuration to specify binding and endpoint information

Page 19: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

19

Consuming Services From Workflows

Brian NoyesChief ArchitectIDesign Inc (www.idesign.net)

claireh
NOTE TO SPEAKERS: Demo failure is the #1 cause of low scores. Increase speed and reliability by using the virtual demo. For detailed information, consult the Virtual Demo tab of the speaker portal (www.msteched.com).
Page 20: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

SendActivity Limitations

• Default security on NetTcpContextBinding and WSHttpContextBinding are Windows Authentication based on host process identity

• Default security on BasicHttpBinding is None• Can configure a client certificate for certificate

authentication in host process app.config• No reasonable way to use username/password or

token authentication● Solution: custom activity that encapsulates a normal

WCF proxy

Page 21: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

Summary

• WF fits nicely into the SOA picture with .NET 3.5 capabilities

• Consider WF for front end service coordination (orchestration)

• Consider WF for service processing implementation

• Can be used for workflow-workflow coordination as well

Page 22: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

Resources

• IDesign WF Master Class (3 days)• Developing Applications with Windows Workflow Foundation, Brian Noyes,

LiveLesson training DVD, http://www.softinsight.com/LiveLesson • Pro WF, Bruce Bukovics, Apress• Essential Windows Workflow Foundation, Dharma Shukla and Bob Schmidt,

Addison Wesley, 2006.http://www.awprofessional.com/bookstore/product.asp?

isbn=0321399838&rl=1 • Will Work For Process – Create and Run Workflows, Brian Noyes, The

Server Side .NET, August 2006. http://www.theserverside.net/tt/articles/showarticle.tss?id=WorkforProcess

• Manage Application Processes with Windows Workflow Foundation, Brian Noyes, The Server Side .NET, March 2006, http://www.theserverside.net/tt/articles/showarticle.tss?id=ManageAppProcesses

• Avoid - Presenting Windows Workflow Foundation, Sams Publishing, 2005.

E-mail: [email protected]: http://briannoyes.net

Page 23: VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc () brian.noyes@idesign.net

Your Feedback is Important

Please fill out a session evaluation form and either put them in the basket near the exit

or drop them off at the conference registration desk.

Thank you!