SOA 307 Windows Communication Foundation Adapters in Biz
SOA 307 Windows Communication Foundation Adapters in Biz. Talk Server 2006 R 2 Ulrich Roxburgh Services 2 Ltd. 1
Biz. Talk Server + Services BTS 2004/2006 supports Web services But the support has been limited to date SOAP/WSE adapters only go so far Modern SOA’s need more flexibility Around transport, encodings, WS-* protocols Such as what’s provided by WCF
WCF Adapters in R 2 comes with a new set of WCF adapters Offers full integration with WCF runtime Brings WCF channels into BTS messaging Now possible to leverage WS-* in Biz. Talk We’ll cover these new adapters in-depth With focus on scenarios + underlying design
WCF Fundamentals A few key WCF fundamentals to understand Programming model Hosting model Configuration system
Demo
WCF Runtime Architecture Service Layer Client Method Service Method objects Proxy Message Dispatcher Messaging Layer encoder transport Channel Stack Message protocol Method raw message bytes 0101101 protocol encoder transport Channel Stack
WCF Bindings Binding Class Name Transport Message Security Encoding Version Mode RM Tx Flow* Basic. Http. Binding HTTP Text SOAP 1. 1 None X X WSHttp. Binding HTTP Text SOAP 1. 2 WS-A 1. 0 Message Disabled WS-AT Net. Tcp. Binding TCP Binary SOAP 1. 2 Transport Disabled Ole. Tx Net. Named. Pipes. Binding Net. Msmq. Binding Named Pipes MSMQ Binary SOAP 1. 2 Transport X Ole. Tx Binary SOAP 1. 2 Message X X Custom. Binding You decide You decide Notes: X = Not Supported, WS-A = WS-Addressing, WS-AT = WS-Atomic. Transactions, Ole. Tx = Ole. Transactions * Transaction flow is always disabled by default, but when you enable it, these are the default protocols
Introducing the WCF Adapters The WCF adapters complete the bridge between BTS and. NET 3. 0 Usage similar to any other BTS adapter Create send ports / receive locations Select a WCF adapter as the transport Configure adapter to control WCF settings Configuration stored in SSO as usual
Demo
WCF Adapter Suite Adapter Name WCF Binding When to use? WCF-Basic. Http. Binding WCF-WSHttp. Binding WCF-Net. Tcp. Binding WCFNet. Named. Pipe WCF-Net. Msmq Net. Named. Pipe. Binding Net. Msmq. Binding WCF-Custom Any WCFCustom. Isolated Any When you need interoperability with WS-I Basic Profile 1. 1 services When you need interoperability with more advanced services that leverage WS-* protocols When you need efficient inter-machine communication with other WCF applications When you need efficient intra-machine communication with other WCF applications When you need durable, asynchronous communication with other WCF applications When you need to define a custom binding configuration for an “in-process” host When you need to define a custom binding configuration for an “isolated” host
WCF Adapter Architecture Key areas to understand WCF adapter generic contracts Send adapter architecture (consuming) Receive adapter architecture (hosting) Exposing service metadata Security and transaction options Custom adapter configurations Integration with orchestrations
Generic Service Contracts The WCF adapters use generic contracts IOne. Way. Async, ITwo. Way. Async, . . . Allows ports to process any message shape Operations typed using Message, Action=“*” Operations are always two-way (unless using Net. Msmq. Binding) (Use Reflector to view)
Send Adapter Architecture Sends messages using a WCF channel Channel dynamically created by adapter One of the generic contracts is used You specify the “action” value Only compatible with two-way operations (unless you’re using Net. Msmq. Binding)
Send Adapter “Action” Mapping <Bts. Action. Mapping> <Operation Name="Submit. Invoice" Action="http: //example. org/Submit. Invoice"/> <Operation Name="Cancel. Invoice" Action="http: //example. org/Cancel. Invoice"/> </Bts. Action. Mapping> 14
Send Adapter msg Templates <Submit. Invoice xmlns="http: //example. org/billing"> <bts-msg-body xmlns="http: //www. microsoft. com/schemas/bts 2007" encoding="xml"/> </Submit. Invoice> 15
Demo
Receive Adapter Architecture Receives messages using a WCF channel A single Service. Host for each receive location (based on Biz. Talk. Service. Instance) Hosted in-proc (Bts. Nt. Svc. exe) or isolated (IIS) Channel dynamically created by adapter One of the generic contracts is used Service implementation publishes incoming message to Message. Box Only supports two-way operations (except when using Net. Msmq. Binding)
Biz. Talk. Service. Instance in Action Receive Port Receive Location WCF Receive Adapter Biz. Talk. Service. Instance Channel Stack transport encoder WCF Message protocol Pipeline Maps decode map disassemble map SOAP validate Body resolve party map Biz. Talk Message Element protocol Message Dispatcher SOAP Body Element decide which part of the message to submit publish Message Box
Message Publishing Options Envelope Publish entire SOAP envelope element Careful w/Xml. Disassembler or you’ll get Body (default) Publish first child of SOAP body element Path Identify the precise element to publish using a forward-only XPath expression
Hosting the WCF Adapters In-process hosting Non-HTTP adapters easily supported via tools HTTP adapters possible via WCF-Custom Isolated hosting All HTTP adapters and WCF-Custom. Isolated Service lifecycle controlled via admin tools
Exposing Service Metadata Receive locations are inherently untyped Hence, exposing metadata doesn’t help You can provide metadata explicitly via tool Using the WCF Service Publishing Wizard
WCF Service Publishing Wizard Generate metadata-only endpoints For services hosted in-proc Generate service endpoints For services hosted in IIS Produces all WCF/IIS artifacts Command-line version also available http: //go. microsoft. com/fwlink/? Link. Id=101820
Security Options WCF provides numerous security options Primarily controlled via security “mode” WCF adapters only surface security settings consistent with underlying binding See Security tab for available options Security “mode” is a required setting Client credentials may also be necessary Most WCF adapters also support SSO
Transaction Options Some WCF bindings support flowing tx’s Flowing a tx into a receive location Joins the transaction for publishing the message to the Message. Box If client aborts, message isn’t published Not possible on two-way receive location Send ports can also flow tx’s to services The Message. Box tx for deleting the outgoing message is flowed to external service
Using the “Custom” Adapters WCF-Custom and WCF-Custom. Isolated Allow you to customize WCF bindings You’re “taking the gloves off”, possible to break Select WCF binding and configure Select “custom. Binding” to start from scratch Specify/configure binding elements Import/export WCF configuration
Customizing WCF Behaviors Custom adapters allow you to customize service/endpoint behaviors Exposed on the “Behavior” tab Allows you to introduce custom behaviors Such as the Bam. Endpoint. Behavior
WCF Adapters in Orchestrations WCF adapters integrate with orchestrations Consume WCF services See the WCF Service Consuming Wizard Launch via “Add Generated Items” Publish orchestrations as WCF services Use the WCF Service Publishing Wizard
WCF Property Schema WCF adapters define a suite of properties Provide access to WCF headers/configuration Accessible in pipelines & orchestrations Name Description Promoted Action To Reply. To. Address Operation name WS-Addressing To header WS-Addressing Reply. To header Yes Yes From. Address Inbound. Headers WS-Addressing From header All of the incoming headers (decrypted) All outgoing headers Yes No Outbound. Custom. Headers No
WCF BAM Interceptor R 2 also ships with a WCF BAM interceptor Allows WCF apps to capture BAM data Implemented as a WCF behavior (Bam. Endpoint. Behavior) Injects message/parameter inspectors Data capture driven by IC files
Summary The WCF adapters in R 2 bring the flexibility of WCF into the Biz. Talk messaging layer Built-in adapters cover common scenarios Use custom adapters for everything else Flexible hosting/metadata options/tool support Brings increased transport/encoding flexibility Adds support for standard WS-* protocols
References See Windows Communication Foundation Adapters in Biz. Talk Server 2006 R 2 (whitepaper) by Aaron Skonnard
Resources for Developers www. microsoft. com/teched Tech·Talks Live Simulcasts Tech·Ed Bloggers Virtual Labs http: //microsoft. com/msdn Developer’s Kit, Licenses, and MORE!
33 © 2007 Microsoft Corporation. All rights reserved. Microsoft, 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.
- Slides: 34