Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Introduction to Windows Communication Foundation Ruwan Wijesinghe.

Slides:



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

Siebel Web Services Siebel Web Services March, From
WCF Intro Scott Reed Owner - Brain Hz Software Instructor – DevelopMentor
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
 Introduction  WCF Definition  WCF Architecture  Implementation  WCF Demo Overview.
Presentation 7 part 2: SOAP & WSDL. Ingeniørhøjskolen i Århus Slide 2 Outline Building blocks in Web Services SOA SOAP WSDL (UDDI)
Latest techniques and Applications in Interprocess Communication and Coordination Xiaoou Zhang.
Windows Communication Foundation and Web Services.
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
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Web Services (ASMX 2.0 and WSE 3.0) Mike Taulty Developer & Platform Group Microsoft Ltd
Module 13: WCF Receive Adapters. Overview Lesson 1: Introduction to WCF Receive Adapters Lesson 2: Configuring a WCF Receive Adapter Lesson 3: Using the.
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.
Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311.
Bruno Terkaly | Technical Evangelist Bret Stateham | Technical Evangelist.
Introduction SOAP History Technical Architecture SOAP in Industry Summary References.
[Title of the course] WCF
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.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
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#:
Web Services Description Language CS409 Application Services Even Semester 2007.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
Intro to WCF From the beginning and uses Steve AppRochester.
XML Web Services Architecture Siddharth Ruchandani CS 6362 – SW Architecture & Design Summer /11/05.
Random Logic l Forum.NET l Web Services Enhancements for Microsoft.NET (WSE) Forum.NET ● October 4th, 2006.
A Deep Dive into Best Practices with the Windows Communication Foundation John Justice COM415 Program Manager Microsoft Corporation.
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.
SCA Bindings Simon Holdsworth Piotr Przybylski. Agenda n SCA Bindings Overview l Bindings TC Charter n Bindings l Web Services Binding l JMS Binding l.
INT-9: Implementing ESB Processes with OpenEdge ® and Sonic ™ David Cleary Principal Software Engineer.
Kemal Baykal Rasim Ismayilov
Windows Communication Foundation David Anderson Independent Software Developer DCOM Productions.
Chapter 7: Creating and Consuming XML Web Services Understanding XML Web Services Creating XML Web Services Deploying and Discovering XML Web Services.
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.
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
1 G52IWS: Web Services Description Language (WSDL) Chris Greenhalgh
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ć.
Nati Dobkin
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
Jim Fawcett CSE681 – SW Modeling & Analysis Spring 2005
Windows Communication Foundation
Windows Communication Foundation
Windows Communication Foundation
Sabri Kızanlık Ural Emekçi
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
Window Communication Foundation
WCF.
Windows Communication Foundation (WCF)
Distribution of functionality Webservice using WCF
Windows Communication Foundation and Web Services
Windows Communication Foundation (WCF)
Presented by: Francisco Martin-Recuerda
Distributed System using Web Services
WEB SERVICES From Chapter 19, Distributed Systems
Distributed Applications on Windows Vista
The SOAP Story Martin Parry Developer & Platform Group Microsoft Ltd
Distributed System using Web Services
Presentation transcript:

Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Introduction to Windows Communication Foundation Ruwan Wijesinghe

2 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Windows Communication Foundation Provide a unified communication model for all windows based distributed application development technologies (ASMX web services,.Net Remoting, Enterprise Services, MSMQ) Fully Support WS-I and hence interoperable with applications developed in other platforms Support transport mediums like TCP – Efficient intranet communication HTTP – For communication over the fire walls (Internet) Named Pipes – For efficient inter process communication MSMQ – Reliable messaging Support three messaging patterns Simplex – Send a message and do not expect a reply Duplex – Send a message with a callback interface. Service can replies asynchronously using this callback interface, if required. Request Reply – Send a message and expect a reply

3 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Hosting Services Internet Information Server (IIS) – Supports, clustering, domain recycling, etc. IIS 6 supports only HTTP IIS7 (WAS) supports any communication protocol Windows Executables – Windows and Console applications can host services as s means of inter-process communication Windows Services – Windows services can be used to host WCF services. This can be used as a means of inter-process communication as well as for distributed application development

4 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Service Endpoint ServiceEndpoints contain the ABCs of a service. EndpointAddress (A): A WCF service endpoint has a URI. EndpointAddress contains the URI, optional Address Headers and an optional Identity field (only useful when having multiple end points that shares the same URI) Binding (B): Bindings are a portion of the Policy that a service and consumer have to agree on if they want to exchange messages. This binding will contain the information to support the features being exposed by the service. ContractDescription (C): There are a number of different types of contracts with WCF. The primary contract that defines service is the service contract. This is analogous to the portType within WSDL today.

5 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Binding Binding contains following information Name – Name of the binding Namespace – The namespace that makes the binding name unique BindingElements – A list of binding elements that defines different aspects of the expected binding

6 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Exactly what does the binding tell us? Bindings are capable of answering a number of questions about how a client and a service will communicate. Here are the key questions that are answered. What level of interoperability does this service have?.NET to.NET or WS* specifications. What type of encoding is used? Text, MTOM or Binary What type of transports can be used? TCP, HTTP, Named Pipe, or MSMQ. What type of messaging patterns can be used? Simplex, duplex, or request-reply. What type of security is supported? Windows security, WS-Security, or transport level security. Is transaction flow supported? Are reliable sessions supported?

7 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Binding Elements A binding is a set of Binding Elements Types of Binding Elements Transport Bindings – Binding which determines the transport type (e.g. TCP, HTTP, MSMQ, etc.) Protocol Binding – The binding which process SOAP headers and implement protocols like (WS-Security, etc.) Example Bindings Security Binding Element ReliableSession Binding Element TcpTransport Binding Element

8 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Contract Description ContractDescription contains the following parts Name – Name of the service Namespace – The namespace that makes the service name unique OperationDescription – Descriptions of the operations (methods) of the service Message Description – Descriptions of the input and output messages of the service ContractBehavior – ContractBehaviors modifies or extend the behavior of the service contract

9 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Service Description Services are described using ServiceDescriptions ServiceDescripion contsins ServiceType – The type that provide the service IServiceBehavior – The modifications or extensions to the service E.g. ServiceMetadataBehavior determines if the service publishes its metadata ServiceEndpoint – A set of ServiceEndpoints as discussed in previous slides (EndpointAddress, Binding and Contract)

10 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Channels Channels are used by clients to communicate with services There are two types of channels Transport Channels – Channels used to support transport mediums like TCP Protocol Channels – Channles used to support SOAP based protocols like WS- Security Generally a set of channels are used to access a given service endpoint Channels are described by ChannelDescriptions which contains, IChannelBehavior – Set of modifications or extensions to the channel behavior ServiceEndpoint – Service endpoints as discussed earlier

11 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Service Configuration A configuration file entry of a service hosted in IIS or WAS is given below <endpoint address="svc" binding="basicHttpBinding" contract="ServiceLibrary.IEchoService"/> <endpoint address="net.tcp://localhost:8081/echo/svc" binding="netTcpBinding" contract="ServiceLibrary.IEchoService"/>

12 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Predefined Bindings. Binding InteropEncodingTransportMessagingSecurityTransactionReliable BasicProfileBasicTextHTTP, HTTPS Request- reply, Simplex TransportNo WSProfileWS*Text, MTOMHTTP, HTTPS Request- reply, Simplex Transport, WS-Security Yes WSProfileDualHT TP WS*Text, MTOMHTTPRequest- reply, Simplex, Duplex WS-SecurityYes NETProfileTcp.NETBinaryTCPRequest- reply, Simplex Transport, WS-Security Yes NetProfileDualTcp.NETBinaryTCPRequest- reply, Simplex, Duplex WS-SecurityYes NetProfileNamed Pipe.NETBinaryNamed pipeRequest- reply, Simplex, Duplex TransportYesNo NetProfileMsmq.NETBinaryMSMQSimplexTransport, WS-Security YesNo MsmqIntegrationMSMQTextMSMQSimplex-Yes Intermediary--HTTP, TCP, named pipe ----

13 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Instance Modes Single – Use a single instance to serve all the requests PerSession – New instance will be created per session PerCall – New instance will be created per request (method call) Shared – Instances will be pooled and shared

14 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Service Interface [ServiceContract(Name="EventsService)] public interface IEventsService { [OperationContract(Name = "SaveEvent")] void SaveEvent(LinkItem item); [OperationContract(Name = "GetEvent")] LinkItem GetEvent(); }

15 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Implementing Interface public class EventsService: IEventsService { private LinkItem m_linkItem; public void SaveEvent(LinkItem item) { m_linkItem = item; } public LinkItem GetEvent() { return m_linkItem; }

16 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Data Contracts [DataContract(Name="LinkItem")] public class LinkItem { [DataMember(Name="Id", IsRequired=false, Order=0)] private long m_id; [DataMember(Name = "Title", IsRequired = true, Order = 1)] private string m_title; [DataMember(Name="Desc", IsRequired = false, Order = 2)] private string m_desc; public long Id { get { return m_id; } set { m_id = value; } } public string Title { get { return m_title; } set { m_title = value; } } public string Description { get { return m_description; } set { m_description = value; } }

17 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Message Contracts [MessageContract] public class SaveEventRequest { private string m_licenseKey; private LinkItem m_linkItem; [MessageHeader(MustUnderstand=true)] public string LicenseKey { get { return m_licenseKey; } set { m_licenseKey = value; } } [MessageBody(Order=0)] public LinkItem LinkItem { get { return m_linkItem; } set { m_linkItem = value; } }

18 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Service Interface with Messages [ServiceContract(Name="EventsService")] public interface IEventsService { [OperationContract(Name = "SaveEvent")] SaveEventResponse SaveEvent(SaveEventRequest message); [OperationContract(Name = "GetEvent")] GetEventResponse GetEvent(GetEventRequest message); }

19 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Hosting a Service in an Executable Services can be hosted in any executable These services can be configured Directly by code Using a configuration file (recommended) Configuring using code ServiceHost sh = new ServiceHost(typeof(MathService)); sh.AddServiceEndpoint( typeof(IMath), //contract type new WSHttpBinding(), //one of the built-in bindings " //the endpoint's address); sh.Open(); //create and open the service runtime

20 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL WCF Clients WCF can be written by using two techniques Direct Code ChannelFactory factory = new ChannelFactory ( new WSHttpBinding(), new EndpointAddress(" IMath channel = factory.CreateChannel(); int result = channel.Add(35,7); factory.Close(); Using Proxy MathProxy proxy = new MathProxy(); int result = proxy.Add(35, 7);

21 Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Loggin Messages WCF can be configured to log its incoming and outgoing messages SvcTraceViewer tools can be used to analyze this data