var318: developing service oriented workflows brian noyes idesign inc () [email protected]
Post on 19-Dec-2015
219 views
TRANSCRIPT
VAR318: Developing Service Oriented Workflows
Brian Noyes
IDesign Inc (www.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
Agenda
• SOA Overview• WF Service Capabilities• Exposing WF Workflows as Services• Consuming Services from Workflows
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
SOA Tenets
• Service boundaries are explicit
• Services are autonomous
• Services share schema and contract, not type
• Services are compatible based on policy
5
Loan Application Process
Workflow as Orchestration
Exchange SQL DB SQL DB
Workflow as Service Operation
Transfer Money
DebitManager
CreditManager
AuthorizationManager
Loan Application Process
FundManager
Agenda
• SOA Overview• WF Service Capabilities• Exposing WF Workflows as Services• Consuming Services from Workflows
WF Service Capabilities
• WF leverages WCF’s ability to define, expose, and call services● Interoperable● Extensible● Productive ● Complies with SOA tenets
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
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
Agenda
• SOA Overview• WF Service Capabilities• Exposing WF Workflows as Services• Consuming Services from Workflows
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
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
Multiple Clients per Workflow
• Will need to extract instanceID from message headers● Proxy inner channel context manager
16
Exposing Workflow Services
Brian NoyesChief ArchitectIDesign Inc (www.idesign.net)
Agenda
• SOA Overview• WF Service Capabilities• Exposing WF Workflows as Services• Consuming Services from Workflows
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
19
Consuming Services From Workflows
Brian NoyesChief ArchitectIDesign Inc (www.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
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
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
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!