A Lap Around the Windows Communication Foundation Omri
- Slides: 45
A Lap Around the Windows Communication Foundation Omri Gazitt COM 202 Group Program Manager Connected Systems Division Microsoft Corporation 1
PRESENTATION Presentation Framework System. Windows (3. 0) DATA ASP. NET System. Web (2. 0) Compilation Configuration Handlers Hosting Mail Management Security UI (2. 0) Util Annotations Automation Controls Data Documents Ink Interop Navigation Resources Serialization Shapes Printing Subsystem Threading System. Printing (3. 0) System. Windows. Media (3. 0) GDI+ 3 D System. Drawing Animation Design Imagine Drawing 2 D Windows Forms Printing System. Windows. Forms (2. 0) Design Layout Visual. Styles ADO. NET System. Data Common Odbc Ole. Db Oracle. Client Sql. Client COMMUNICATION Language Integrated Query System. Query (F) System. Data. DLinq (F) System. Xml. XLinq (F) System. Expressions (F) Windows File System. Storage (F) Core Audio ASP. NET Data Management Calendar System. Web Contacts Caching Documents Profile Image Session. State Media Messages XML Data Rules System. Xml Sync Schema Video Serialization XPath XPS Documents Xsl System. Windows. Xps (3. 0) System. IO. Packaging (3. 0) Windows Communications Foundation System. Service. Model (3. 0) Channels Configuration Diagnostics Integration System. Service. Model. Security(3. 0) Protocols Tokens Network Class Library System. Net Cache Mail (2. 0) Network Information (2. 0) Security (2. 0) Sockets Windows Workflow Foundation System. Workflow (3. 0) System. Workflow. Activities (3. 0) Rules System. Workflow. Component. Model (3. 0) Complier Desinger Serializaztion System. Workflow. Runtime (3. 0) Hosting Messaging ASMX Web Services System. Web. Services Identity Management Microsoft. Info. Cards (3. 0) MSMQ . NET Remoting System. Messaging System. Runtime. Remoting Directory Services . NET Remoting System. Directory. Services System. Runtime. Remoting Speech Integration System. Speech (3. 0) Recognition Synthesis FUNDAMENTALS BASE CLASS LIBRARIES System. Text System. Code. Dom System. Service. Process System. Resrouces System. Text Access. Control Managed Add-In Framework (2. 0) System. Addins (F) Cryptography (2. 0) Contact Permissions Microsoft. Build (2. 0) System. Configuration Policy Principal (2. 0) System. Enterprise. Services System. Transactions (2. 0) System. Component. Model System. Threading System. Timers System. Diagonostics System. IO (2. 0) System. Text Generic (2. 0) System. Reflection Email System. Runtime Compiler. Services Constrained. Execution (2. 0) Interop. Services Hosting Serialization Versioning “Click. Once” Deployment System. Deployoment (2. 0) KEY (2. 0) (3. 0) - New WINDOWS VISTA (2. 0) - Substantially Improved - Windows Presentation Foundation (formerly codenamed “Avalon”) - Windows Communication Foundation (formerly codenamed “Indigo”) 2 - Windows Workflow Foundation
Windows Communication Foundation The unified programming model for rapidly building serviceoriented applications on the Windows platform Unification Service Orientation Integration Unifies today’s distributed technology stacks Appropriate for use on-machine, cross machine, and cross Internet • Codifies best practices for building distributed applications Interoperates with applications running on other platforms Integrates with our own distributed stacks 3
Programming WCF 101 4
Clients and Services Client Service 5
Endpoints Client Service Endpoint 6
Address, Binding, Contract Client Service C B A A B C Address Binding Contract Where? How? What? Endpoint 7
Creating Endpoints Client Service C B A Client. Channel A B C Service. Host 8
“Hello World” with WCF 9
Contract & Service Definition [Service. Contract] public interface IHello { [Operation. Contract] string Hello(string name); } public class Hello. Service : IHello { public string Hello(string name) { return “Hello, ” + name; } } 10
Service Hosting Self-host class Hello. Host { static void Main(string[] args) { Service. Host host = new Service. Host(typeof(Hello. Service)); host. Open(); // Wait until done accepting connections Console. Read. Line(); host. Close(); } } WAS/IIS-host http: //localhost/Hello. Service. svc <%@ Service Language=“C#” Class=“Hello. Service” %> 11
Service Configuration <? xml version="1. 0" encoding="utf-8" ? > <configuration> <system. service. Model> <services> <service type=“Hello. Service" <endpoint address=“http: //localhost/Hello. Service" binding=“basic. Http. Binding" contract="IHello" /> </services> </system. service. Model> </configuration> 12
Client Implementation class Client { static void Main() { IHello proxy = Channel. Factory. Create. Channel<IHello>(“Hello. Endpoint”); string r = proxy. Hello(“Omri”); Console. Write. Line(r); } } <system. service. Model> <client> <endpoint configuration. Name=“Hello. Endpoint" address="http: //localhost/Hello. Service" binding="basic. Http. Binding" contract="IHello" /> </client> </system. service. Model> 13
Programming WCF 102 Contracts Bindings Metadata Behaviors 14
Indster Amazon WSDL R/R C B A B C A Basic Indster Client C B A Duplex. Contract Peer C B A Tcp C B WS Request/Reply, One. Way A B C Indster Client Peer A B C Tcp Indster Service A A B C R/R 15
Contracts 16
Contracts in WCF public class Order { public int order. ID; public int part. Number; public int price; public string info; public void Process(); public Get. Info(); } [Data. Contract] public class Order { [Data. Member] public int order. ID; [Data. Member] public int part. Number; [Data. Member] public int price; [Data. Member] public string info; } [Data. Contract] public class Query { [Data. Member] public int order. ID; } [Service. Contract] public interface IOrder. Service { [Operation. Contract] void Process(Order o); [Operation. Contract] Info Get. Info(Query q); } [Data. Contract] public class Info { [Data. Member] public string info; } 17
Describing Messages Untyped (“universal”) Typed Message Parameters: shorthand for [MC] void Chat(Message m) { } void Chat(Chat. Request m) { } [Message. Contract] public class Chat. Request { [Message. Header] public string Me; [Message. Body] public string Text; } void Chat(string name, string text) { } 18
Describing Messages wsdl: message wsdl: part xsd: element [Message. Contract] public class My. Request { [Message. Body] public Unit. Info; [Message. Body] public bool Is. In. Use; } [Data. Contract] public class Unit. Info { [Data. Member] public int ID; [Data. Member] public string Name; } 19
Data Contracts and Types Indster Client C B A Peer C B Tcp A Data. Contract, Parameters Stream A B C Indster Client Peer A B C Tcp 20
Describing Message Exchanges Service. Contract ties together multiple operations [Service. Contract] wsdl: port. Type wsdl: operation Operation. Contract ties together Message Contract, Action public interface My. Contract { [Operation. Contract( Action="urn: Do. It", Reply. Action="urn: Done")] My. Reply Do. It(My. Request request); [Operation. Contract( Action="urn: Do. It. Again", Reply. Action="urn: Done. Again")] Message Do. It(Message request); } 21
Describing Message Exchanges Request/Reply [Operation. Contract] string Echo(string text); One-way Message [Operation. Contract(Is. One. Way = true)] void Chat(string text); Duplex Contracts [Service. Contract(Callback. Contract = typeof(IChat)] public interface IChat { [Operation. Contract(Is. One. Way = true)] void Chat(string text); } Actions control Dispatch [Operation. Contract( Action = “Foo”, Reply. Action = “Foo. Response”)] Message Foo(Message request); “*” matches all actions [Operation. Contract(Action = “*”)] void Dispatch(Message request); 22
Request/Reply and Asynchrony One-way messages modeled using One. Way=true operation contracts [Operation. Contract(Is. One. Way = true)] void Chat(Message request); Correlated Request/Reply modeled either as synchronous method [Operation. Contract] Message Chat(Message request); or using IAsync. Result pattern [Operation. Contract(Async. Pattern=true)] IAsync. Result Begin. Chat(Message request, Async. Callback cb, object state); Message End. Chat(IAsync. Result call); 23
Service/Operation Contracts Indster Client C B A Peer C B Tcp A Duplex. Contract Request/Reply One. Way A B C Indster Client Peer A B C Tcp 24
Contract Features Service and Operation Contracts Duplex, Sessionful MEPs One-Way, Request-Reply, First/Last Operation, Faults MEP Versioning Message and Data Contracts Message Schema Versioning Fine-grained Control Action, Direction, Headers, Body, Wrapped/Bare, RPC/Doc, Literal/Encoded 25
Bindings 26
Inside Bindings Binding HTTP Transport Text Security RM TX Protocol Encoders TCP HTTP Text Security RM MSMQ IPC Binary TX . NET Custom 27
Standard Bindings Session Transactions T T|S T|S T|S X X X X S t re a mi n g Security BP 1. 1 WS WS. NET Duplex I n t e ro p Basic. Http. Binding Ws. Dual. Http. Binding Net. Tcp. Binding Net. Named. Pipes. Binding Net. Msmq. Binding Net. Peer. Tcp. Binding O O X T = Transport Security | S = WS-Security | O = One-Way Only 28
Integration using Bindings WCF * Binding Http/WS Binding Java WCF WS-* Protocols Http/WS Binding WCF WS-* Protocols Http/WS WCF WS-* Protocols Java MSMQ Protocol MSMQ Binding WCF ASMX/WSE 3 Binding MSMQ WCF * Binding WS-* Protocols Http/WS ASMX/WSE 3 WCF WS-* Protocols MSMQ Protocol MSMQ Binding WCF MSMQ 29
Choosing Bindings have semantics Session, Duplex, Transaction Flow, Transacted Read, Queued Delivery, Ordered, Assurances Asserting Semantic Requirements in Code [Service. Contract] [Binding. Requirements] 30
C Bindings B A Basic Indster Client Peer Channel COM 311 Sandeep Singhal Tue 2: 45 pm WCF 4 XML-heads COM 326 Doug Purdy Thu 5: 15 pm C B A Peer C B Tcp C B WS A A “Under the Hood” COM 416 Steve Swartz Wed 5 pm Writing Channels COM 424 Yasser. S / Kenny. W Thu 3: 45 pm 31
Binding Features Encoding Text, Binary, Custom Transport selection TCP, HTTP, Named Pipes, P 2 P, MSMQ, Custom End-to-end Security Confidentiality, integrity, auth. N, auth. Z, federation Credentials: X 509, User/Pwd, Kerberos, SAML, Info. Card, Custom End-to-end Reliable messaging Transport independent Qo. S (in order, exactly once) Volatile and durable queues for availability Transactions Shared transactions for “synchronous” operations Transactional queues for “asynchronous” operations 32
Metadata 33
Describing Endpoints Client Service Get. Metadata WSDL Proxy. cs C B A A B C app/web. config 34
Generating Proxies Using Svcutil Amazon WSDL R/R C B A B C A Basic Indster Client Interoperability COM 423 Kirill G / Simon G Thu 2: 15 pm 35
Behaviors 36
Behaviors Client Service C B Be Client Behavior A A B C Be Service Behavior 37
Example: Security Secure Apps COM 312 Martin Gudgin Wed 1: 45 pm Client Service C B A Be A B C Be Bindings Insert Claims in Messages Infocards COM 321 Andy Harjanto Thu 11: 30 am Behaviors Implement Security Gates Extending Security COM 430 Doug Walter Fri 8: 30 am 38
Example: Reliable Messaging Client Service C B A Bindings do Ordering, Sessions, Guarantees A B C Reliable, TX Apps COM 307 Shy Cohen Wed 3: 15 pm 39
Example: Transactions Client Service C B A Be Bindings Flow Transactions Behaviors Auto. Enlist and Auto. Complete A B C Be Reliable, TX Apps COM 307 Shy Cohen Wed 3: 15 pm 40
Using Behaviors “Under the Hood” COM 412 Steve Swartz Thu 10 am Extending SM COM 429 Mike Vernal Fri 10: 30 am 41
Behavior Features Concurrency, Instancing, Throttling, Thread-Binding Faults, Exceptions Metadata customization Instance Pooling and JITA Impersonation, Protection, Authorization Auto. Enlist, Isolation, Auto. Complete 42
Features Summary Address Binding http: //. . . HTTP Transport net. p 2 p: //. . . Peer Transport net. tcp: //. . . net. pipe: //. . . net. msmq: //. . . xxx: //. . . WS-Security Protocol WS-RM Protocol Named. Pipe Transport WS-Coord Protocol Custom Transport Request/ Response Behavior Instancing Behavior Concurrency Behavior Throttling Behavior TCP Transport MSMQ Transport Contract Metadata Behavior One-Way Error Behavior Transaction Behavior Custom Behavior Security Behavior Duplex Channel Duplex Custom Protocol Externally visible, per-endpoint Opaque, per-service, endpoint, or operation 43
More Resources 20 WCF or WCF-related sessions Identity/Access COM 214 John Shewchuk Wed 3: 15 pm COM+/MSMQ COM 305 Andy Milligan Wed 11 am Managing Services COM 308 Alex Weinert Wed 1: 45 pm, 5 pm Hosting Services COM 413 Steve Maine Fri 1 pm WCF Tips&Tricks COM 415 John Justice Thu 10 am ASMX/WSE COM 432 Mark Fussell Fri 8: 30 am 11 WCF Hands-on Labs Communications Track Lounge omrig@microsoft. com www. gazitt. com/blog (Indster code) 44
Please Fill Out An Eval! © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. 45
- Omri shmueli
- Omri elisha
- Hổ sinh sản vào mùa nào
- Sự nuôi và dạy con của hổ
- Thế nào là mạng điện lắp đặt kiểu nổi
- Endlap and sidelap
- Windows identity foundation windows 10
- Windows communication foundation wcf performance
- What goes around comes around example
- Goes around comes around meaning
- Pile foundation details
- Composition of urine
- Windows platform foundation
- Systemparametersinfo
- Windows workflow foundation
- Windows driver foundation disable
- User mode driver framework
- Mark russinovich
- Video movie
- Windows media player 9
- Live mail windows 7
- Windows driver kit windows 7
- Herramientas de movie maker
- Windows media player 9 skins
- Upgrade windows 7 to windows 10
- Setup windows xp virtual machine
- Windows mobile center windows 10
- Manual windows movie maker
- Windows vista windows 10
- Windows 10 xp mode
- Hình ảnh bộ gõ cơ thể búng tay
- Lp html
- Bổ thể
- Tỉ lệ cơ thể trẻ em
- Chó sói
- Glasgow thang điểm
- Chúa sống lại
- Các môn thể thao bắt đầu bằng tiếng chạy
- Thế nào là hệ số cao nhất
- Các châu lục và đại dương trên thế giới
- Cong thức tính động năng
- Trời xanh đây là của chúng ta thể thơ
- Cách giải mật thư tọa độ
- Phép trừ bù
- độ dài liên kết
- Các châu lục và đại dương trên thế giới