1 Understanding Windows Communication Foundation Nick Page Application Architect Microsoft Ltd.

Slides:



Advertisements
Similar presentations
Indigo Jonathan Turnbull Nick Cartwright Ivan Konontsev Chris Bright.
Advertisements

May 2, 2006Shawn Mulkey - EECS Distributed Computing & Object Oriented Middleware: Part 2 Presented By Shawn Mulkey.
Aplicaciones Distribuidas Manuel Zegarra Sánchez Microsoft Certified Application Developer.
Nima Dilmaghani nimad.wordpress.com Developer & Platform Evangelism.
 Introduction  WCF Definition  WCF Architecture  Implementation  WCF Demo Overview.
1 Nordjyllands Erhvervakademi Windows Communication Foundation Introduction –.Net foundations –Communication Protocols –SOA tenets WCF –Basics –Contracts.
Windows Communication Foundation and Web Services.
© 2007 Charteris plc20 June Extending Web Service Security with WS-* Presented by Chris Seary MVP Charteris plc, Bartholomew Close, London.
Adam Dille CS526 – Spring  Advances in Microsoft’s service offerings  ASMX vs. WCF  Latest WCF Improvements (.NET 4.0)  No in-depth study of.
The Microsoft Technical Roadshow 2006 Windows Communication Foundation Mike Taulty Developer & Platform Group Microsoft Ltd
Web Services (ASMX 2.0 and WSE 3.0) Mike Taulty Developer & Platform Group Microsoft Ltd
1 Understanding Windows Communication Foundation and Workflow Foundation Eric Nelson Application Architect.
Getting Started with Windows Communication Foundation 4.5 Ed Jones, MCT, MCPD, MCTS Consultant RBA Inc.
Getting Started with WCF Windows Communication Foundation 4.0 Development Chapter 1.
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Introduction to Windows Communication Foundation Ruwan Wijesinghe.
Keith Elder Microsoft MVP INETA Speaker Blog: Demystifying Windows Communication Foundation.
Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts How to host WCF services.
1 Windows Communication Foundation: Integrating COM+ and MSMQ Applications Andy Milligan COM305 Program Manager Microsoft Corporation.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
1 IIS and Windows Communication Foundation: Hosting Services Steve Maine COM 413 Program Manager Microsoft Corporation
1 “Indigo”: Services And The Future Of Distributed Applications Don Box Architect Microsoft Corporation here –
1 UCN 2012 Why use distributed (client / server) applications? To connect tiers within the same application... –client & server is both.NET assemblies.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
Intro to WCF From the beginning and uses Steve AppRochester.
Paul Johansen – October Mankato.NET Users Group. Agenda  WCF Essentials  Bunch o’ demos Coding from scratch Why the Visual Studio tools suck  Additional.
Random Logic l Forum.NET l Web Services Enhancements for Microsoft.NET (WSE) Forum.NET ● October 4th, 2006.
Developing Web Services Using ASP.NET and WSE That Interoperate with the Windows Communications Foundation ("Indigo") Mark Fussell COM432 Lead Program.
.NET Enterprise Services COM+ 1.5 麥超俊 Bobby Mak 架構技術推廣經理開發工具暨平台推廣處台灣微軟股份有限公司.
Mahesh Krishnan, Senior Consultant, Readify Slide 1.
Telerik Software Academy Web Services & Cloud.
2 Productive Windows Communication Foundation Jeremy Boyd Mindscape MSDN Regional Director – New Zealand SOA315.
Web Services Error Handling and Debugging. Agenda Simple SOAP faults Advanced SOAP faults SOAP headers and faults Error handling From a Service Perspective.
Presentation 24: Windows Communication Foundation Introduced Objektorienteret Netværkskommunikation.
Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts How to host WCF services.
Web Services Security Patterns Alex Mackman CM Group Ltd
Dhananjay Kumar MVP-Connected System 1. WCF  Agenda What is WCF ? Why WCF? Address, Binding, Contract End Points Hosting Message Patterns Programming.
Christian Weyer thinktecture.
Introduction to.NET FX 3.0 (+ sneak preview of.NET FX 3.5) Martin Parry Developer & Platform Group Microsoft Ltd
The SOAP Story Martin Parry Developer & Platform Group Microsoft Ltd
For Developers Martin Parry Developer and Platform Group Microsoft
Windows Communications Foundation ("Indigo"): Writing Secure Distributed Applications Martin Gudgin COM312 Program Manager Microsoft Corporation.
1 “Indigo” & Web Services Roadmap David Gristwood.
Windows Communication Foundation António Cruz Freelancer (SAPO/PT.COM)
.NET Framework Enterprise. Agenda WCF Overview WCF Solutions WF Overview WF Solutions Card Spaces Bringit it all together: Dinner Now Scenario.
Justin Smith Technical Evangelist Microsoft Corporation CON301.
Shani Raba Team Leader & Software Architect
OE-NIK HP Advanced Programming WCF WCF SOAP service, host, client Exception handling (NOT required)
Windows Communication Foundation Stipe Ivan Latković.
O VERVIEW OF SOA AND WCF Jinaldesai.net – My Thouths And Learnings.
Windows Communication Foundation. Agenda How We Got Here ASMX vs WCF Throwdown WCF Contracts Service Data Message Bindings Security Reliability Declarative.
Windows Communication Foundation and Web Services
Windows Communication Foundation
4/12/2018 2:37 PM Windows Communication Foundation: Migration, interop, upgrade, and integration Risman Adnan ISV Lead, Microsoft Indonesia
Windows Communication Foundation
Window Communication Foundation
The Windows Communication Foundation Programming Model - Contracts
WCF.
Windows Communication Foundation
Windows Communication Foundation (WCF)
Distribution of functionality Webservice using WCF
Windows Communication Foundation and Web Services
Windows Communication Foundation
אפליקציות אסינכרוניות ל-Windows 10
Modeling & Messaging for Connected Systems
for Developers Martin Parry Developer and Platform Group Microsoft
Windows Communication Foundation (WCF)
Distributed Applications on Windows Vista
The SOAP Story Martin Parry Developer & Platform Group Microsoft Ltd
Presentation transcript:

1 Understanding Windows Communication Foundation Nick Page Application Architect Microsoft Ltd

2 Agenda Why another way to do A to B Basic Principles of WCF Creating a Service

Windows Communication Foundation 1996 ISV1996 ISV - Applications are Islands - Internal only - ISAM. Client/Server just becoming popular - Interop using flat files – CSV, ftp, shares - Microsoft offered simple proprietary technology-DCOM 2006 ISV2006 ISV - Applications are part of solutions - Internal and External users - Composability - Security - Scalability - “Interop” becomes core requirement

Windows Communication Foundation Which technology? Remoting ASMX / WSE DCOM System.Messaging Enterprise Services Microsoft Sockets RMI JAX-RPC CORBA JMS EJB J2EE Sockets

Interop with other platforms ASMX Attribute-BasedProgramming Enterprise Services WS-*ProtocolSupport WSE Message-OrientedProgramming System.Messaging Extensibility Location transparency.NET Remoting WCF Windows Communication Foundation Unified Programming Model

6 Side-by-side co-existence with existing distributed technologies Seamless communication with applications built on existing technologies Smooth upgrade of existing code to WCF Investment Protection Leveraging Existing Microsoft Investments ASMX ASMX ASMXESWSE3

7 using System.Web.Services; public class AccountingOperation { public string AccountName; public long Amount; } public class Accounting { [WebMethod(TransactionOption=TransactionOption.RequiresNew)] public int AddEntry(AccountingOperation debit, AccountingOperation credit) { // Add entry to internal accounting book // return id. } } using System.ServiceModel; [ServiceContract(FormatMode=ContractFormatMode.XmlSerializer)] [OperationContract] [OperationBehavior(AutoEnlistTransaction=true)] // ASMX to WCF

8 Basic Principles  Clients and Services  Endpoints  A, B, C  Behaviors

9 Client Service Clients and Services

10 Client Service Endpoints Endpoint

11 Client Service Address, Binding, Contract CBA CBA CBA A BC Address Where? Contract What? Binding How?

12 Client Service Behaviors CBA CBA CBA A BC B B B

13 Selecting… AddressBinding BehaviourContract HTTP Transport TCPTransport NamedPipe Transport MSMQ Transport Custom Transport WS-Security Protocol WS-RM Protocol WS-Coord Protocol Duplex Channel Custom Protocol net.tcp://... net.pipe://... net.msmq://... xxx://... ThrottlingBehavior Metadata Behavior Error Behavior Custom Behavior Instancing Behavior Concurrency Behavior Transaction Behavior Security Behavior Request/ Response One-Way Duplex net.p2p://... PeerTransport Externally visible, per-endpoint Opaque, per-service, endpoint, or operation

14 Creating a Service  Define What to Expose (Contract)  Implement Contract  Define Endpoint(s)  Define How to Expose (Binding)  Define Where to Expose (Address)  Host & Run Service

15 C ontracts A Service is a CLR Class that Implements One or More Service Contracts [DataContract] public class OrderDetail { [DataMember] public string ItemName { get; set; } [DataMember] public Guid ItemId { get; set; } [DataMember] public double ItemPrice { get; set; } } [ServiceContract] public interface IOrderProcessingService { [OperationContract(IsOneWay = true)] void ProcessOrder(OrderDetail detail); } class OrderProcessingService : IOrderProcessingService { public void ProcessOrder(OrderDetail detail) {... } } [DataContract] public class OrderDetail { [DataMember] public string ItemName { get; set; } [DataMember] public Guid ItemId { get; set; } [DataMember] public double ItemPrice { get; set; } } [ServiceContract] public interface IOrderProcessingService { [OperationContract(IsOneWay = true)] void ProcessOrder(OrderDetail detail); } class OrderProcessingService : IOrderProcessingService { public void ProcessOrder(OrderDetail detail) {... } }

16 Encoding Text, Binary, MTOM, Custom Transport Selection TCP, HTTP, Named Pipes, Peer Channel, MSMQ, Custom End-to-End Security Confidentiality, Integrity, AuthN, AuthZ, Federation & Infocard X.509, Username/Password, Kerberos, SAML, XrML, Custom End-to-End Reliable Messaging Transport-Independent QoS (In-Order / Exactly-Once) Volatile and Durable Queues for Availability Transactions Shared Transactions for “Synchronous” Operations Transactional Queues for “Asynchronous” Operations B inding

17 A ddresses Scheme http, https, net.tcp, net.pipe Host Name microsoft.com Port (Optional) * 80, 443, 808 Base Path /OrderService/ Endpoint Address WS, BP, TCP, NP * - Port Does Not Apply to Named Pipes

18 Hosting ServiceHost allows for hosting anywhere Console applications Windows applications Windows services IIS provides an enterprise class hosting environment Edit a.svc file and point at your service HTTP transport in IIS 6.0 All transports in IIS 7.0 (Windows Activation Service)

19 ServiceHost Allows a WCF Service to be Hosted in Any AppDomain EXE, NT Service, WinForms, Avalon, etc. public static void Main(string[] args) { ServiceHost host = new ServiceHost( typeof(OrderProcessingService); host.BaseAddresses.Add( new Uri(“ host.Open(); } public static void Main(string[] args) { ServiceHost host = new ServiceHost( typeof(OrderProcessingService); host.BaseAddresses.Add( new Uri(“ host.Open(); }

20 Windows Communication Foundation Svctraceviewer.exeSvcconfigeditor.exe + so much more

21 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

22 WCF Code Migration

23 using System.Web.Services; public class AccountingOperation { public string AccountName; public long Amount; } public class Accounting { [WebMethod(TransactionOption=TransactionOption.RequiresNew)] public int AddEntry(AccountingOperation debit, AccountingOperation credit) { // Add entry to internal accounting book // return id. } } using System.ServiceModel; [ServiceContract(FormatMode=ContractFormatMode.XmlSerializer)] [OperationContract] [OperationBehavior(AutoEnlistTransaction=true)] // ASMX to WCF

24 public class Accounting : ServicedComponent { public void AddCreditEntry(string creditAccount, int creditAmount) { } using System.EnterpriseServices; [ComponentAccessControl] [SecureMethod] [Transaction(TransactionOption.Required)] [SecurityRole("Manager")] using System.ServiceModel; [ServiceContract] [OperationContract] [OperationBehavior(AutoEnlistTransaction=true)] [PrincipalPermission(SecurityAction.Demand, Role="Managers")] // Enterprise Services to WCF

25 using Microsoft.Web.Services3; [WebService] class HelloWorld { [WebMethod] public string Hello (string text) { MessageSignature signature = (MessageSignature) RequestSoapContext.Current.Security.Elements[0]; if (!signature.SigningToken.Principal.IsInRole ("BUILTIN\Administrators")) throw new AuthorizationException("Access denied"); return String.Format("Hello, {0}", text); } } Note: Configuration entry changes are required [OperationContract] [PrincipalPermission(SecurityAction.Demand, null, "BUILTIN\Administrators")] using System.ServiceModel; [ServiceContract] // // // // // // // // WSE to WCF

26 class MyQService { public void ReceiveOrders() { MessageQueue Queue = new XmlMessageFormatter formatter = new XmlMessageFormatter( new Type[] { typeof(System.Data.DataSet)}); Queue.Formatter = formatter; System.Messaging.Message msg = null; while((msg= Queue.Receive()) != null) { DataSet booklist = (DataSet) msg.Body; ProcessOrders(booklist); } } Public void ProcessOrder(DataSet BookList) {... } } using System.Messaging; using System.ServiceModel; [ServiceContract] [OperationContract(IsOneWay = true)] // // // // // // // // // // // // // System.Messaging to WCF

27 using System.Runtime.Remoting; [Serializable] public class AccountingOperation { public string AccountName; public long Amount; } public class Accounting { public int AddEntry(AccountingOperation debit, AccountingOperation credit) { // Add entry to internal accounting book // return id. } } using System.ServiceModel; [ServiceContract] [OperationContract] : MarshalByRefObject //.NET Remoting to WCF