Windows Communication Foundation

Slides:



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

WCF Intro Scott Reed Owner - Brain Hz Software Instructor – DevelopMentor
Web Services Darshan R. Kapadia Gregor von Laszewski 1http://grid.rit.edu.
Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
 Introduction  WCF Definition  WCF Architecture  Implementation  WCF Demo Overview.
Latest techniques and Applications in Interprocess Communication and Coordination Xiaoou Zhang.
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.
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.
The Microsoft Technical Roadshow 2006 Windows Communication Foundation 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.
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Introduction to Windows Communication Foundation Ruwan Wijesinghe.
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#:
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
Intro to WCF From the beginning and uses Steve AppRochester.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
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.
Claims-Based Identity Solution Architect Briefing zoli.herczeg.ro Taken from David Chappel’s work at TechEd Berlin 2009.
2 Productive Windows Communication Foundation Jeremy Boyd Mindscape MSDN Regional Director – New Zealand SOA315.
Kemal Baykal Rasim Ismayilov
Windows Communication Foundation David Anderson Independent Software Developer DCOM Productions.
Web Services Security with Visual Studio 2005 Muhammad Saqib Ilyas
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.
Configuring and Deploying Web Applications Lesson 7.
.NET Mobile Application Development XML Web 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)
.NET Framework Enterprise. Agenda WCF Overview WCF Solutions WF Overview WF Solutions Card Spaces Bringit it all together: Dinner Now Scenario.
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.
CORBA Antonio Vasquez, John Shelton, Nidia, Ruben.
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
Sabri Kızanlık Ural Emekçi
Window Communication Foundation
WCF.
Windows Communication Foundation
Windows Communication Foundation (WCF)
Distribution of functionality Webservice using WCF
Windows Communication Foundation and Web Services
The future of distributed systems architecture
WSE 3.0 的网络服务安全 Security in WSE 3.0 Hongmei Ge Con321
for Developers Martin Parry Developer and Platform Group Microsoft
Windows Communication Foundation (WCF)
Student: Popa Andrei-Sebastian
Distributed System using Web Services
Distributed Applications on Windows Vista
The SOAP Story Martin Parry Developer & Platform Group Microsoft Ltd
Distributed System using Web Services
Presentation transcript:

Windows Communication Foundation António Cruz Freelancer (SAPO/PT.COM) antonio.cruz@co.sapo.pt

Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts Transactions Security Management Integration and Extensibility

What Is the Windows Communication Foundation? Yesterday: Remoting COM D/COM WSE MSMQ ASMX COM+ Many confusing and complicated options The Windows Communication Foundation, which was code-named “Indigo,” is a technology by which pieces of software can communicate with one another. There are many other such technologies, including COM and DCOM, RMI, MSMQ, and WebSphere MQ. Each of those works will work well in a particular scenario, not so well in others, and is of no use at all in some cases. The Windows Communication Foundation is meant to work well in any circumstance in which software entities must be made to communicate with one another. In fact, it is meant to always be the very best option: It provides performance that is about as good as, if not better than, any other alternative; it offers at least as many features and probably several more; and it will certainly be the easiest solution to program. WCF is a software factory template for software communication. It consists of a DSL, called the Service Model, and a class framework, called the Channel Layer. WCF is a complete infrastructure for service-oriented programming. Now: Windows Communication Foundation One simple choice that is always the best option

Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts Transactions Security Management Integration and Extensibility

How Does It Work? Data Service Model Metadata Channel Layer Messages Address, Binding, Contract, and Behaviors Metadata Concretely, the Windows Communication Foundation consists of a number of class libraries within the .NET 3 Framework. The most important of those class libraries are the Service Model and the Channel Layer. The Service Model provides you with a small, simple language for modeling how you want your software to communicate. In the language of the Service Model, a piece of software that responds to communications over a network is a service, a service has one or more endpoints, and each endpoint consists of an address (where), a binding (how), and a contract (what). The address defines where the service is located. The binding specifies the set of protocols that it uses to communicate. Contracts define the messages that services can send and receive. At runtime, the Windows Communication looks at the binding that you have defined and assembles, from the Channel Layer, a stack of channels that implement the protocols specified by the binding that you chose. Then, when you have data to send, the Windows Communication Foundation translates your data into a message, and passes the message through the stack of channels it has assembled, so that your message is send on its way in accordance with the protocols identified by your binding. Messages that are received are decoded by the channel stack, and translated into the data that you are expecting. Implementations of new protocols can readily be added to the channel layer. Thus, the Windows Communication Foundation protects your investment by allowing you to continue to use the same simple programming framework provided by the Service Model with any communication protocol you may encounter. Addresses, bindings and contracts defined with the Service Model are all automatically described in metadata, which by default, is in the form of the standard Web Services Description Language. By virtue of the metadata, developers of client application can learn about the endpoints of a service, find out the address, binding and contract of each of those endpoints. They are able to generate client code for communicating with the service from that information provided by the metadata. However, the Service Model language has an additional element that one can use in defining how a piece of software is to communicate that does not surface in the metadata: behaviors. Behaviors are used to control how messages are handled internally, such as whether new instances of your classes are constructed to handle each incoming data, or whether all of the incoming data is sent to the same instance of your classes. It is because such internal processing details don’t affect how a client and a server communicate with one another that behavior options are not included in the metadata for a service. Channel Layer Protocols, Encoders, and Transports Messages

Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts Transactions Security Management Integration and Extensibility

How Do I Use It? Service Contract Definition Contract Implementation public interface IMyInterface { [OperationContract] public MyOutputType MyMethod(MyInputType myData); } Service Contract Definition [ServiceBehavior(InstanceContextMode=Single] public class MyService: IMyInterface { public MyOutputType MyMethod(MyInputType myData) { //my code … } Contract Implementation (Service Type) The development of a Windows Communication Foundation service begins with a developer defining a contract. That is done by writing an interface in a .NET programming language, and then adding attributes from the Service Model that designate the interface as a Windows Communication Foundation contract, and one or more of the methods as being included in the contract. The next step is to implement the contract, which is done simply by writing a class that implements the interface. A class that implements an interface that is designated as a Windows Communication Foundation contract is called a “service type.” How the Windows Communication Foundation conveys data to and from the service type from the outside can be controlled by adding behaviors to the service type definition using the ServiceBehavior attribute. For example, the instance context mode attribute shown here controls whether all incoming data is sent to a new instance of the service type, or to a single instance, amongst other options. Finally, an administrator configures endpoints for the service by associating an address and a binding with the contract and service type provided by the programmer. The configuration of endpoints is defined in a regular .NET configuration file, but a configuration editor is provided so that administrators don’t have to write configuration XML. <service name=“MyService”> <endpoint address=“MyAddress” binding=“netTcpBinding” contract=“IMyInterface” /> <service/> Endpoint Configuration

Self-Host within any .NET process: How do I Deploy It? Web Host within IIS: For HTTP services on Windows XP® SP2 & WS2K3 For any service on Windows Vista® and Windows Server® “Longhorn” Proven reliability, scalability, and security Requires a .svc file to identify the Service Type Self-Host within any .NET process: Available for any service Console apps, windowed apps, .NET NT Services …

Building a Simple Service and Client

Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts Transactions Security Management Integration and Extensibility

You can choose a pre-defined binding: All About Bindings You can choose a pre-defined binding: <endpoint name=“MyService” address=“MyAddress” binding=“netTcpBinding” contract=“IMyInterface” /> NetPeerTcpBinding NetMsmqBinding NetNamedPipeBinding NetTcpBinding WSHttpBinding BasicHttpBinding Binding .NET Peer  Peer .NET.NET via MSMQ .NET.NET across processes Secure, reliable duplexed Basis for WS-* interop Supports WS-Security, WS-RM, WS-Tx Basic Profile 1.1 Interop and Integration w/ASMX Purpose

You can customize a pre-defined binding All About Bindings You can customize a pre-defined binding <services> <service name=“MyService”> <endpoint address=“MyAddress” binding=“wsHttpBinding” bindingConfiguration=“MyReliableBinding” contract=“IMyInterface” /> <service/> </services> <bindings> <wsHttpBinding> <binding name=“MyReliableBinding”> <reliableSession enabled=“true” ordered=“true” </binding> </wsHttpBinding> </bindings>

You can define custom bindings All About Bindings You can define custom bindings <?xml version=“1.0” encoding=“UTF-8” ?> <configuration> <system.serviceModel> <services> <service name=“MyService”> <endpoint address=“MyAddress” binding=“customBinding” bindingConfiguration=“MyCustomBinding” contract=“IMyInterface” /> </service> </services> <bindings> <customBinding> <binding name="MyCustomBinding"> <reliableSession advancedFlowControl="true” /> <security authenticationMode=“Kerberos” /> <binaryMessageEncoding /> <tcpTransport maxMessageSize=“9223372036854775807" /> </binding> </customBinding> </bindings> </system.serviceModel> </configuration>

Reliability

Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts Transactions Security Management Integration and Extensibility

All About Addresses The scheme portion of an address corresponds to the transport protocol: NetNamedPipeBinding NetMsmqBinding NetTcpBinding BasicHttpBinding, WSHttpBinding Binding net.pipe://… net.msmq://… net.tcp://… http://... Scheme IPC – Interprocess communication The schemes clearly indicate which protocols have been standardized.

An endpoint address is relative to a base address: All About Addresses An endpoint address is relative to a base address: <services> <host> <baseAddresses> <add baseAddress="http://localhost:8000/MyBaseAddress"/> </baseAddresses> </host> <service name=“MyService”> <endpoint address=“MyEndpointAddress” binding=“wsHttpBinding” bindingConfiguration=“MyReliableBinding” contract=“IMyInterface” /> <service/> </services> For a Web-Hosted service, the base address is that of its virtual directory

Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts Transactions Security Management Integration and Extensibility

All About Contracts Look again at this service contract: public interface IMyInterface { [OperationContract] public MyOutputType MyMethod(MyInputType myData); } How do MyOutputType and MyInputType get serialized into messages? Serialization is done by DataContractSerializer by default Handles “built-in” .NET Framework types automatically User-defined types require Data Contracts: [DataContract] public class MyDataContract { [DataMember] public string MyField; } Can opt for the older, slower XmlSerializer: [ServiceContract] [XmlSerializerFormat] public interface IMyInterface

WCF in a Nutshell Externally visible, per-endpoint Opaque, per-service, endpoint or operation Address Binding Contract Behavior HTTP Transport WS-Security Protocol Request/ Response Instancing Behavior Concurrency Behavior http://... Peer Transport net.p2p://... Throttling Behavior TCP Transport WS-RM Protocol net.tcp://... Metadata Behavior NamedPipe Transport WS-Coord Protocol net.pipe://... One-Way Error Behavior Transaction Behavior MSMQ Transport Duplex Channel net.msmq://... Custom Behavior Security Behavior Duplex Custom Transport Custom Protocol xxx://...

Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts Transactions Security Management Integration and Extensibility

WCF Transaction Managers Lightweight Transaction Manager (LTM) Single AppDomain, single durable resource, multiple volatile, one service, maximum performance. Distributed Transaction Coordinator (DTC) Transactions across process and network, uses OleTx or WS-AT, multiple services, flows client and services transactions, system service. Kernel Transaction Manager (KTM) Vista/Longhorn only, transactional file system (TxF) & registry (TxR), uses LTM (multiple volatile resources, one service).

Transactions

Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts Transactions Security Management Integration and Extensibility

All About Security Authentication Authorization A message may incorporate a security token The security token has claims about the sender The type of security token is configured with the binding Built-in support for these token types: Windows (Kerberos or NTLM) Username (a user name & a password) X.509 certificate CardSpace tokens SAML tokens Can add support for custom token types Authorization Authorization configured w/ServiceAuthorizationBehavior Authorization options: For users authenticated using Windows tokens: Principal Permissions ASP.NET Role Provider For users authenticated using any sort of token: a ServiceAuthorization manager

Message-Level Security

Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts Transactions Security Management Integration and Extensibility

All About Management Integrated Management Management Model Tools Microsoft Operations Manager 2005 Management Pack Integrated Management Management Model Microsoft Management Model Designer Tools CIM Studio ScriptOMatic PowerShell Configuration Editor Trace Viewer PerfMon PowerShell CmdLet Instruments (Data & Control Points) Configuration System WMI Provider Tracing and Logging Performance Counters Management Interface

Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts Transactions Security Management Integration and Extensibility

All About Integration Client Service Integration Strategy ASMX WCF WCF Configure WCF components to use BasicHttpBinding Remoting WCF WSE 2 WCF Remoting WSE 2 Upgrade Remoting & WSE 2 components to WCF WCF WSE 3 WSE 3 WCF For HTTP, use properly configured WSHttpBinding For TCP, custom TCP transport sample on NETFX3.com WCF COM+ Use COMSVCConfig.exe to wrap COM+ app w/WCF endpoint COM WCF Service Monikers

All About Extensibility Contract Contract WSDL Exporter Client Code parameters Service Type parameters Operation Invoker Parameter Inspector Parameter Inspector Message Formatter Message Formatter Message Inspector Instance Provider Typed Proxy Message Inspector Dispatcher Operation Selector Channel Custom Channel Custom Channel Channel Channel Custom Channel Custom Channel Channel Transport Channel byte[] Transport Channel byte[] Encoder Encoder Custom Transport Custom Encoder Custom Encoder Custom Transport * Added by configuring the runtime with behaviors * Added by adding binding elements to the binding

REST and POX extensibility

Summary What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts Transactions Security Management Integration and Extensibility

Links http://wcf.netfx3.com/ http://blogs.msdn.com/drnick/ http://www.idesign.net/ http://www.arquitecturadesoftware.org/blogs/antoniocruz António Cruz Freelancer (SAPO/PT.COM) antonio.cruz@co.sapo.pt