Presentation 24: Windows Communication Foundation Introduced Objektorienteret Netværkskommunikation.

Slides:



Advertisements
Similar presentations
WCF Intro Scott Reed Owner - Brain Hz Software Instructor – DevelopMentor
Advertisements

May 2, 2006Shawn Mulkey - EECS Distributed Computing & Object Oriented Middleware: Part 2 Presented By Shawn Mulkey.
 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.
Darryl Burling Developer Evangelist Microsoft The age of connected applications Whats new in VS2008 WCF Background: WS*,.Net 3.0 and WCF ABC’s & improvments.
X.509 support in WCF Exploring support for X.509 Certificates in Microsoft’s Windows Communication Foundation Paul Cormier UCCS CS591 Fall 2009.
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
Jon Flanders INT303. About Me  Jon Flanders –  Independent consultant/trainer  BizTalk MVP.
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.
WCF Services in Nutshell A Tutorial using WCF Mr. Michael Arnwine WCF using Service Oriented Architecture (SOA) and “Restful” Service.
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.
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Introduction to Windows Communication Foundation Ruwan Wijesinghe.
[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.
SOA Visão Geral das Funcionalidades de Descoberta e Roteamento de Serviços em WCF 4.
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#:
Presentation: Other Object Oriented Middlewares. Outline Web services Java RMI.NET Remoting WCF For each technology Compare: heterogenity (platform, OS,
CSCI 6962: Server-side Design and Programming Web Services.
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.
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.
Mahesh Krishnan, Senior Consultant, Readify Slide 1.
Telerik Software Academy Web Services & Cloud.
Introducing the ABCs of Windows Communication Foundation | Feb 2006 rickgaribay.net Windows Communication Foundation Hosting & Endpoints Winter 2006.
Presentation 23:.NET Remoting Introduced Objektorienteret Middleware.
Kemal Baykal Rasim Ismayilov
Windows Communication Foundation David Anderson Independent Software Developer DCOM Productions.
Web Services Security with Visual Studio 2005 Muhammad Saqib Ilyas
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
Windows Communication Foundation António Cruz Freelancer (SAPO/PT.COM)
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.
The Mechanics of HTTP Requests and Responses and network connections.
Windows Communication Foundation and Web Services
Jim Fawcett CSE681 – SW Modeling & Analysis Spring 2005
Windows Communication Foundation
Segments Introduction: slides 2–7 10 minutes
4/12/2018 2:37 PM Windows Communication Foundation: Migration, interop, upgrade, and integration Risman Adnan ISV Lead, Microsoft Indonesia
Windows Communication Foundation
Windows Communication Foundation
Window Communication Foundation
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
Windows Communication Foundation (WCF)
Distributed Applications on Windows Vista
The SOAP Story Martin Parry Developer & Platform Group Microsoft Ltd
WCF Data Services and Silverlight
Presentation transcript:

Presentation 24: Windows Communication Foundation Introduced Objektorienteret Netværkskommunikation

Introducing WCF Windows Vista =>.NET Framework 3.0 Also for Windows XP, 2003 Server & 2007 Not Windows Mobile / Windows CE Unified Service-Oriented Programming Model Replaces / Suplements.NET Remoting DCOM ASP.NET Web services MSMQ (Queued Messaging).NET Enterprise Services Protocol Neutrality and Flexibility

Learning WCF WCF much like.NET Remoting / ASP.NET WS Easier / More extensive ITONK will adress key issues of WCF

WCF Basic Concepts Remote system (like.NET Remoting) is: Exchanging Messages Using Channels, consisting of Encodeders Transports Also called the Channel layer On top of this is the Service Model Layer

WCF Architecture

Channels Channels is chain of stacks Much like.NET Remoting Sending messages, being encoded and transported

Messages WCF Applications Exchanges Messages Modelled on SOAP messages Envelope, header, body Adressing Messages are smallest unit of transmission Messsages have a SOAP and addressing version

Messages Message Exchange Pattern (MEP) One way, request, response, duplex

Channels Messages are payload Channels provide transmission stream Protocol channels Independent of transport Extensible Transport channels HTTP, TCP, MSMQ, P2P, Named Pipes Extensible

Encoders Text (XML, interop) JSON/POX (XML or JSON, interop) MTOM (XML with binary part, interop) Binary (non-interop)

Service Model Layer Channel Layer may be used alone – but low level Service Model Layer Build on top of Channel Layer.NET Typed layer Uses object serialization to generate message XML

Endpoints Applications communicates through endpoints Endpoints defined by WCF ABC Address (where is the service) Binding (which transport and encoding to use) Contract (what operations are available)

Contracts Uses annotated.NET interfaces

Contracts Like in ASP.NET – only expose explict annotated operations

Bindings Many Bindings: Interopable basicHttpBinding webHttpBinding wsHttpBinding, wsFederationHttpBinding WCF Specific netTCPBinding netPeerTcpBinding netNamedPipeBinding netMsmqBinding MSMQ interop MsmqlIntegrationBinding Extensible (write your own)

WCF Bindings Matrix

Choose your Binding Before – you had to choose different middlewares Now – just choose different bindings

Hosting Services Two models supported Self-hosting: own process (console, winform) WAS hosting Windows Activation Service Supported by IIS7 Emulated for IIS6 for HTTP/S

Self-hosting Make a ServiceHost, Add Endpoints, Call Open

Creating a Client Dynamic Proxies supported (like.NET Remoting) Use ChannelFactory for this

Specify Endpoint in Config file

Behaviors Behaviors can be used to affect the internals of WCF Eg. Transaction Flow Has nothing to do with the wire Many build-in behaviors, but extensible for own Attributes can be used [ServiceBehavior], [OperationBehavior] Configuration file defined behaviors Code defined behaviors

Meta Data Two ways of sharing contracts WSDL or Shared Contract DLL

Creating Static Proxies Unlike.NET Remoting, which only supports dynamic proxy generation there is also static gen. in WCF Or ”Add Service Reference” in VS

Defining the Contract using System.ServiceModel; //a WCF contract defined using an interface [ServiceContract] public interface IMath { [OperationContract] int Add(int x, int y); } using System.ServiceModel; //a WCF contract defined using an interface [ServiceContract] public interface IMath { [OperationContract] int Add(int x, int y); } //the service class implements the interface public class MathService : IMath { public int Add(int x, int y) { return x + y; } } //the service class implements the interface public class MathService : IMath { public int Add(int x, int y) { return x + y; } }

Implementing the Service public class WCFServiceApp { public void DefineEndpointProgrammable() { //create a service host for MathService ServiceHost sh = new ServiceHost(typeof(MathService)); //use the AddEndpoint helper method to //create the ServiceEndpoint and add it //to the ServiceDescription sh.AddServiceEndpoint( typeof(IMath), //contract type new WSHttpBinding(), //one of the built-in bindings " //the endpoint's address //create and open the service runtime sh.Open(); } public void DefineEndpointInConfig() { //create a service host for MathService ServiceHost sh = new ServiceHost (typeof(MathService)); //create and open the service runtime sh.Open(); } public class WCFServiceApp { public void DefineEndpointProgrammable() { //create a service host for MathService ServiceHost sh = new ServiceHost(typeof(MathService)); //use the AddEndpoint helper method to //create the ServiceEndpoint and add it //to the ServiceDescription sh.AddServiceEndpoint( typeof(IMath), //contract type new WSHttpBinding(), //one of the built-in bindings " //the endpoint's address //create and open the service runtime sh.Open(); } public void DefineEndpointInConfig() { //create a service host for MathService ServiceHost sh = new ServiceHost (typeof(MathService)); //create and open the service runtime sh.Open(); } Create the Service Endpoint Programmatically Create the Service Endpoint Programmatically Create the Service Endpoint Using a Configuration File (see next slide) Create the Service Endpoint Using a Configuration File (see next slide)

Configuration File <configuration xmlns=" <endpoint address=" binding="wsHttpBinding" contract="IMath"/> <configuration xmlns=" <endpoint address=" binding="wsHttpBinding" contract="IMath"/>

Implementing the Client Using Static Proxy //this class is generated by svcutil.exe //from the service's metadata //generated config is not shown here public class MathProxy : IMath {... } public class WCFClientApp { public void SendMessageToEndpoint() { //this uses a proxy class that was //created by svcutil.exe from the service's metadata MathProxy proxy = new MathProxy(); int result = proxy.Add(35, 7); proxy.Close(); } //this class is generated by svcutil.exe //from the service's metadata //generated config is not shown here public class MathProxy : IMath {... } public class WCFClientApp { public void SendMessageToEndpoint() { //this uses a proxy class that was //created by svcutil.exe from the service's metadata MathProxy proxy = new MathProxy(); int result = proxy.Add(35, 7); proxy.Close(); }

Implementing the Client Using Dynamic Proxy public class WCFClientApp { public void SendMessageToEndpointUsingChannel() { //this uses ChannelFactory to create the channel //you must specify the address, the binding and //the contract type (IMath) ChannelFactory factory=new ChannelFactory ( new WSHttpBinding(), new EndpointAddress(" IMath channel=factory.CreateChannel(); int result=channel.Add(35,7); factory.Close(); } public class WCFClientApp { public void SendMessageToEndpointUsingChannel() { //this uses ChannelFactory to create the channel //you must specify the address, the binding and //the contract type (IMath) ChannelFactory factory=new ChannelFactory ( new WSHttpBinding(), new EndpointAddress(" IMath channel=factory.CreateChannel(); int result=channel.Add(35,7); factory.Close(); }

Data transfer objects WCF support DTO’s Use [DataContract] decoration All serializable objects may be used instead -> less configurable

Plenum Discussion Use 5 minutes in your groups: Differences with Web services /.NET Remoting Strength over Web services /.NET Remoting Weaknesses compared to –”-? Plenum: 5 minutes discussion of findings