Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introducing the BizTalk Windows Communication Foundation Adapters Aaron Skonnard Technical Founder, Pluralsight.

Similar presentations


Presentation on theme: "Introducing the BizTalk Windows Communication Foundation Adapters Aaron Skonnard Technical Founder, Pluralsight."— Presentation transcript:

1 Introducing the BizTalk Windows Communication Foundation Adapters Aaron Skonnard Technical Founder, Pluralsight

2 Session Prerequisites Some basic experience is assumed Windows Communication Foundation BizTalk Server 2004/2006

3 BizTalk 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

4 WCF adapters in R2 R2 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 BizTalk We’ll cover these new adapters in-depth With focus on scenarios + underlying design

5 WCF fundamentals A few key WCF fundamentals to understand Programming model Hosting model Configuration system

6 WCF runtime architecture ServiceClient Method protocol encoder transport protocol encoder transport Service Layer Messaging Layer ProxyDispatcher 0101101 raw message bytes objects Message Channel Stack Message objects

7 WCF bindings Notes: X = Not Supported, WS-A = WS-Addressing, WS-AT = WS-AtomicTransactions, OleTx = OleTransactions * Transaction flow is always disabled by default, but when you enable it, these are the default protocols Binding Class NameTransport Message Encoding Message Version Security Mode RMTx Flow* BasicHttpBindingHTTPTextSOAP 1.1NoneXX WSHttpBindingHTTPText SOAP 1.2 WS-A 1.0 MessageDisabledWS-AT NetTcpBindingTCPBinarySOAP 1.2TransportDisabledOleTx NetNamedPipes- Binding Named Pipes BinarySOAP 1.2TransportXOleTx NetMsmqBindingMSMQBinarySOAP 1.2MessageXX CustomBindingYou decide

8 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

9 WCF adapter suite Adapter NameWCF BindingWhen to use? WCF-BasicHttpBasicHttpBinding When you need interoperability with WS-I Basic Profile 1.1 services WCF-WSHttpWSHttpBinding When you need interoperability with more advanced services that leverage WS-* protocols WCF-NetTcpNetTcpBinding When you need efficient inter-machine communication with other WCF applications WCF- NetNamedPipe NetNamedPipe- Binding When you need efficient intra-machine communication with other WCF applications WCF-NetMsmqNetMsmqBinding When you need durable, asynchronous communication with other WCF applications WCF-CustomAny When you need to define a custom binding configuration for an “in-process” host WCF- CustomIsolated AnyWhen you need to define a custom binding configuration for an “isolated” host

10 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

11 Generic service contracts The WCF adapters use generic contracts IOneWayAsync, ITwoWayAsync, ITwoWayAsyncVoid, etc. Allows ports to process any message shape Operations typed using Message, Action=“*” Operations are always two-way (unless using NetMsmqBinding)

12 ITwoWayAsyncVoid (example) // used to model one-way ports that don’t use NetMsmqBinding (ACKs) [ServiceContract( Namespace="http://www.microsoft.com/biztalk/2006/r2/wcf-adapter")] public interface ITwoWayAsyncVoid { // Methods [OperationContract(AsyncPattern=true, IsOneWay=false, Action="*", ReplyAction="*")] IAsyncResult BeginTwoWayMethod( Message message, AsyncCallback callback, object state); void EndTwoWayMethod(IAsyncResult result);... }

13 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 NetMsmqBinding)

14 Send adapter “action” mapping <Operation Name="SubmitInvoice" Action="http://example.org/SubmitInvoice"/> <Operation Name="CancelInvoice" Action="http://example.org/CancelInvoice"/> You can specify an action mapping in the send adapter properties, Action value chosen based on BTS.Operation property

15 Send adapter message templates <bts-msg-body xmlns="http://www.microsoft.com/schemas/bts2007" encoding="xml"/> You can also specify a message template for outgoing message, along with encoding for the body (xml, string, base64, hex)

16 Receive adapter architecture Receives messages using a WCF channel A single ServiceHost for each receive location (based on BizTalkServiceInstance) Hosted in-proc (BtsNtSvc.exe) or isolated (IIS) Channel dynamically created by adapter One of the generic contracts is used Service implementation publishes incoming message to MB Only supports two-way operations (except when using NetMsmqBinding)

17 BizTalkServiceInstance [ServiceBehavior( InstanceContextMode=InstanceContextMode.Single, ConcurrencyMode=ConcurrencyMode.Multiple)] internal sealed class BizTalkServiceInstance : ITwoWayAsync, ITwoWayAsyncVoid, IOneWayAsync... {... // implementation omitted } Generic service implementation, responsible for publishing incoming messages to the MessageBox

18 BizTalkServiceInstance in action transport encoder protocol Dispatcher Channel Stack map WCF Receive Adapter decode disassemble validate resolve party PipelineMaps SOAP decide which part of the message to submit Message WCF Message BizTalk Message map BizTalk Message Receive Location Receive Port publish BizTalkServiceInstance SOAP Body Element BodyElement Message Box

19 Message publishing options Envelope Publish entire SOAP envelope element Careful w/XmlDisassembler or you’ll get Body Body (default) Publish first child of SOAP body element Path Identify element to publish using forward-only XPath expression

20 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-CustomIsolated Service lifecycle controlled via admin tools

21 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

22 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/?LinkId=101820

23 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

24 Transaction options Some WCF bindings support flowing tx’s Flowing a tx into a receive location Joins transaction for publishing the message to the MessageBox If client aborts, message isn’t published Not possible on two-way receive location Send ports can also flow tx’s to services The MessageBox tx for deleting the outgoing message is flowed to external service

25 Using the "custom" adapters WCF-Custom and WCF-CustomIsolated Allow you to customize WCF bindings You’re “taking the gloves off”, possible to break Select WCF binding and configure Select “customBinding” to start from scratch Specify/configure binding elements Import/export WCF configuration

26 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 BamEndpointBehavior

27 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

28 WCF property schema WCF adapters define a suite of properties Provide access to WCF headers/configuration Accessible in pipelines & orchestrations NameDescriptionPromoted ActionOperation nameYes ToWS-Addressing To headerYes ReplyToAddressWS-Addressing ReplyTo headerYes FromAddressWS-Addressing From headerYes InboundHeaders All of the incoming headers (decrypted) No OutboundCustomHeadersAll outgoing headersNo

29 WCF BAM interceptor R2 also ships with a WCF BAM interceptor Allows WCF apps to capture BAM data Implemented as a WCF behavior (BamEndpointBehavior) Injects message/parameter inspectors Data capture driven by interceptor configuration (IC) files

30 Summary The WCF adapters in R2 bring the flexibility of WCF into the BizTalk 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

31 Resources Technical Communities, Webcasts, Blogs, Chats & User Groups http://www.microsoft.com/communities/default.mspx http://www.microsoft.com/communities/default.mspx Microsoft Learning and Certification http://www.microsoft.com/learning/default.mspx http://www.microsoft.com/learning/default.mspx Microsoft Developer Network (MSDN) & TechNet http://microsoft.com/msdn http://microsoft.com/technet http://microsoft.com/msdn http://microsoft.com/technet Trial Software and Virtual Labs http://www.microsoft.com/technet/downloads/trials/defa ult.mspx http://www.microsoft.com/technet/downloads/trials/defa ult.mspx New, as a pilot for 2007, the Breakout sessions will be available post event, in the TechEd Video Library, via the My Event page of the website Required slide: Please customize this slide with the resources relevant to your session MSDN Library Knowledge Base Forums MSDN Magazine User Groups Newsgroups E-learning Product Evaluations Videos Webcasts V-labs Blogs MVPs Certification Chats learn support connect subscribe Visit MSDN in the ATE Pavilion and get a FREE 180-day trial of MS Visual Studio Team System!

32 Complete your evaluation on the My Event pages of the website at the CommNet or the Feedback Terminals to win!

33 © 2007 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.


Download ppt "Introducing the BizTalk Windows Communication Foundation Adapters Aaron Skonnard Technical Founder, Pluralsight."

Similar presentations


Ads by Google