SlideShare ist ein Scribd-Unternehmen logo
1 von 61
 
The Windows Communication Foundation
[object Object],[object Object],[object Object],The Connectivity Imperative
.NET At The Core
Windows Communication Foundation The Unified Framework For Rapidly Building  Service-Oriented Applications
Windows Communication Foundation INTEROPERABILITY PRODUCTIVITY SERVICE-ORIENTED DEVELOPMENT ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Unified Programming Model Interop with other platforms ASMX Attribute-  Based Programming Enterprise Services WS-* Protocol Support WSE Message- Oriented Programming System.Messaging Extensibility Location transparency .NET Remoting
WS-* Protocol Support XML Messaging Security Transactions Reliable Messaging Metadata
Investment Protection SIDE-BY-SIDE Interop UPGRADE
SERVICE ORIENTATION
From Objects to Services ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Object-Oriented Service-Oriented Component-Oriented 1980s 2000s 1990s
Four Tenets of Service Orientation SERVICE ORIENTATION Compatibility Based On Policy Share Schema & Contract, Not Class Services Are Autonomous Boundaries Are Explicit
Conventional Web Services ,[object Object],.NET Component ASMX Web Service HTTP Client
WCF Services ,[object Object],.NET Component HTTP Host TCP Host ICP Host MSMQ Host HTTP Client TCP Client ICP Client MSMQ Client Service Contract
The Windows Communication Foundation
Main Design Goal ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Callers and Services Caller Service
Endpoints Caller Service Endpoint Endpoint Endpoint Endpoint
Address, Binding, Contract Service Caller C B A C B A A B C Address Where? Contract What? Binding How? C B A
Creating Endpoints Service Service Host Caller Proxy or ChannelFactory A B C C B A C B A C B A
Exposing & Configuring Endpoints proxy.cs Caller app/web.config GetMetadata WSDL Service ? C B A C B A C B A C B A C B A C B A
Hello World
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
WCF Contracts Overview ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Service Contract [ServiceContract] public interface ICalculator { [OperationContract] int DoMath(int a, int b, string op); }
Service Contract An Opt-In Model [ServiceContract] public interface ICalculator { [OperationContract] int DoMath(int a, int b, string op); // Not exposed as part of the external contract :-) void MethodRequiredForImplementation(bool b); }
Operations Types Message  DoXmlMath( Message  m); Untyped (“Universal”) MathResponse  DoMsgMath( MathRequest  msg); int  DoParamsMath( int a, int b, string op ); Typed Message Parameterized Operations (shorthand for TM)
Service Contract: Names [ServiceContract( Namespace ="http://TechEd.WCF.Intro")] public interface IGreetings { [OperationContract(  Name =“SayHello", Action ="http://TechEd.WCF.Intro/HelloRequest", ReplyAction ="http://TechEd.WCF.Intro/HelloResponse")] string Greet(string name); [OperationContractAttribute( Action = "*" )] void UnrecognizedMessageHandler( Message msg ); } class GreetingService : IGreetings { public string Greet(string name) { return “Hello, " + name; } public void UnrecognizedMessageHandler(Message msg) { Console.WriteLine("Unrecognized message: " + msg.ToString()); } }
Modeling Request/Reply Operations ,[object Object],[object Object],[object Object],[object Object],[object Object],[OperationContract] MathResponse DoMsgMath(MathRequest msg); [OperationContrac t(AsyncPattern=true) ] IAsyncResult BeginDoMsgMath(MathRequest msg,  AsyncCallback cb, object state ) ; MathResponse EndDoMsgMath(IAsyncResult call);
Service Contract: OneWay [ServiceContract] public interface IOneWayCalculator { [OperationContract( IsOneWay=true )] void DoMath(MathRequest request); }
Service Contract: Duplex [ServiceContract(SessionMode=SessionMode.Required,  CallbackContract=typeof(ICalculator Results ) ] public interface ICalculatorProblems { [OperationContract(IsOneWay=true)] void DoMath(MathRequest request); } public interface ICalculatorResults { [OperationContract(IsOneWay=true)] void DisplayResults(MathResponse response); }
Service Contract: Faults t ry { return n1 / n2; } catch (DivideByZeroException e)   { MyMathFault f = new MyMathFault (n1, n2); FaultReason r = new FaultReason(&quot;Divide By Zero&quot;); throw new Fault Exception < MyMathFault >( f, r ); } [ServiceContract(Session=true)] public interface ICalculator { [OperationContract] [FaultContract(typeof( MyMathFault ))] int DoMath(int a, int b, string op); }
Service Contract: Versioning [ServiceContract] public interface  ICalculator2 : ICalculator { [OperationContract(IsOneWay=true)] void SolveAndStoreProblem (ComplexProblem p); }
Service Contract: Streams [ServiceContract ] public interface IStreamCalculator { [OperationContract] Stream  Fibonacci(int iterations); }
Data Contract [DataContract] public enum Position { [ EnumMember ] Employee, [ EnumMember ] Manager, [ EnumMember( Value =  “ Vendor&quot; ) ] Contractor, NotASerializableEnumeration }
Data Contract: Names [DataContract( Name=“Complex”,   Namespace=“http://BigMath.Samples” )] public class ComplexNumber { [DataMember( Name=“RealPart” )]    public double Real = 0.0D;   [DataMember( Name=“ImaginaryPart” )]   public double Imaginary = 0.0D;   public ComplexNumber(double r, double i)   {   this.Real = r;   this.Imaginary = i;   } }
Data Contract: Enumerations [DataContract] public enum Position { [EnumMember] Employee, [EnumMember] Manager, [EnumMember(Value = “Vendor&quot;)] Contractor, NotASerializableEnumeration }
Message Contract [MessageContract] public class ComplexProblem { [MessageHeader(Name=&quot;Op&quot;, MustUnderstand=true)]    public string operation; [MessageBodyMember]   public ComplexNumber n1; [MessageBodyMember]   public ComplexNumber n2; [MessageBodyMember]   public ComplexNumber solution;   // Constructors… }
Mapping Contracts (1/2) [ MessageContract ] public class MyRequest { [MessageHeader]  public int Amount; [MessageBody]   public ItemInfo Info; } [ DataContract ] public class ItemInfo { [DataMember]  public int ID; [DataMember]  public double Cost; [DataMember]  public string Name; } wsdl:message wsdl:part xsd:element
Mapping Contracts (2/2) [ ServiceContract ] public interface MyContract { [OperationContract]   MyReply MyOp(MyRequest request); [OperationContract]   void MyOp2(MyRequest2 request); } wsdl:portType wsdl:operation
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Bindings & Binding Elements Transport IPC MSMQ Custom TCP HTTP Protocol Encoders .NET TX Custom Security Reliability Binding HTTP TX Security Reliability Text Text Binary Custom TCP Binary
Binding Element Features ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
System-Provided Bindings N = None | T = Transport | M = Message | B = Both | RS = Reliable Sessions Binding  Interop Security Session TX Duplex  BasicHttpBinding  BP 1.1 N, T N N n/a WSHttpBinding  WS M , T, X N , T, RS N , Yes n/a WSDualHttpBinding  WS M RS N , Yes Yes WSFederationBinding  Federation M N , RS N , Yes No NetTcpBinding  .NET T , M T  ,RS N , Yes Yes NetNamedPipeBinding  .NET T T , N N , Yes Yes NetPeerTcpBinding  Peer T N N Yes NetMsmqBinding  .NET T , M, X N N , Yes No MsmqIntegrationBinding  MSMQ T N N , Yes n/a
Binding in Config <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?> <configuration> <system.serviceModel> <services> <service serviceType=&quot;CalculatorService&quot;> <endpoint address=&quot;Calculator&quot; bindingSectionName=&quot;basicProfileBinding&quot; contractType=&quot;ICalculator&quot; /> </service> </services> </system.serviceModel> </configuration>
Configuring Bindings <endpoint address=&quot;Calculator&quot;   bindingSectionName=&quot; basic Http Binding &quot;   bindingConfiguration=&quot; UsernameBinding &quot;   contractType=&quot;ICalculator&quot; /> <bindings>   <basicHttpBinding> <binding name=&quot; UsernameBinding &quot;  messageEncoding=&quot;Mtom&quot;> <security mode=&quot;Message&quot;> <message clientCredentialType=&quot;UserName&quot;/> </security> </binding> </basicHttpBinding> < /bindings>
Custom Bindings <bindings> <customBinding> <customBinding> <binding name=&quot;ReliableTCP&quot;> <reliableSession   inactivityTimeout=&quot;0:0:5“ ordered=&quot;true&quot;/> <binaryMessageEncoding/> <tcpTransport transferMode=&quot;Buffered&quot;/> </binding> </customBinding> </customBinding> </bindings>
Choosing Bindings Any Protocol Any Binding Any Binding WCF WCF MSMQ WCF COM+/ES WCF MSMQ Protocol WS-* Protocols MSMQ Binding Moniker ASMX/WSE3 WCF WS-* Protocols Http/WS Binding Other Platform WCF WS-* Protocols Http/WS Binding
Interaction of Bindings and Code ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Behaviors Client-Side  Behaviors Service-Side Behaviors Service Caller Be Be C B A C B A A B C C B A
Behaviors: Overview ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example: Security Service Client Be Be Bindings Move Claims in Messages Behaviors Implement Security Gates Behaviors Provide Credentials C B A C B A A B C C B A
Example: Transactions Service Caller Be Bindings Flow Transactions Behaviors AutoEnlist and AutoComplete C B A C B A A B C C B A
Anti-Example: Reliable Sessions Service Caller Bindings provide Session and Guarantees C B A C B A A B C C B A
Behavior Features ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Features Summary Address Binding Behavior Contract HTTP Transport TCP Transport NamedPipe Transport MSMQ Transport Custom Transport WS-Security Protocol WS-RM Protocol WS-AT Protocol Duplex Channel Custom Protocol http://... net.tcp://... net.pipe://... net.msmq://... xxx://... Throttling Behavior Metadata Behavior Error  Behavior Custom Behavior Instancing Behavior Concurrency Behavior Transaction Behavior Security Behavior Request/ Response One-Way Duplex net.p2p://... Peer Transport Externally visible, per-endpoint Opaque, per-service, endpoint, or op
WCF Application “Architecture” Channels Transport Channels   (IPC, HTTP, TCP…) Reliability Message  Encoder Security Hosting Environments WAS IIS .exe Windows Service DllHost Messaging Services Queuing Routing Eventing Discovery Service Model Application Instance  Manager Context  Manager Type Integration Service Methods Declarative Behaviors Transacted Methods
Presentation Takeaways ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 

Weitere ähnliche Inhalte

Was ist angesagt?

Building RESTful Services with WCF 4.0
Building RESTful Services with WCF 4.0Building RESTful Services with WCF 4.0
Building RESTful Services with WCF 4.0Saltmarch Media
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Peter R. Egli
 
Wcf architecture overview
Wcf architecture overviewWcf architecture overview
Wcf architecture overviewArbind Tiwari
 
Introduction to WCF
Introduction to WCFIntroduction to WCF
Introduction to WCFybbest
 
Windows Communication Foundation (WCF) Service
Windows Communication Foundation (WCF) ServiceWindows Communication Foundation (WCF) Service
Windows Communication Foundation (WCF) ServiceSj Lim
 
Session 1: The SOAP Story
Session 1: The SOAP StorySession 1: The SOAP Story
Session 1: The SOAP Storyukdpe
 
1. WCF Services - Exam 70-487
1. WCF Services - Exam 70-4871. WCF Services - Exam 70-487
1. WCF Services - Exam 70-487Bat Programmer
 
Service Oriented Development With Windows Communication Foundation 2003
Service Oriented Development With Windows Communication Foundation 2003Service Oriented Development With Windows Communication Foundation 2003
Service Oriented Development With Windows Communication Foundation 2003Jason Townsend, MBA
 
Web services, WCF services and Multi Threading with Windows Forms
Web services, WCF services and Multi Threading with Windows FormsWeb services, WCF services and Multi Threading with Windows Forms
Web services, WCF services and Multi Threading with Windows FormsPeter Gfader
 
Web services
Web servicesWeb services
Web servicesaspnet123
 
Overview of Windows Vista Devices and Windows Communication Foundation (WCF)
Overview of Windows Vista Devices and Windows Communication Foundation (WCF)Overview of Windows Vista Devices and Windows Communication Foundation (WCF)
Overview of Windows Vista Devices and Windows Communication Foundation (WCF)Jorgen Thelin
 
Web Services - Architecture and SOAP (part 1)
Web Services - Architecture and SOAP (part 1)Web Services - Architecture and SOAP (part 1)
Web Services - Architecture and SOAP (part 1)Martin Necasky
 

Was ist angesagt? (20)

Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
 
Building RESTful Services with WCF 4.0
Building RESTful Services with WCF 4.0Building RESTful Services with WCF 4.0
Building RESTful Services with WCF 4.0
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
 
Wcf architecture overview
Wcf architecture overviewWcf architecture overview
Wcf architecture overview
 
WCF Fundamentals
WCF Fundamentals WCF Fundamentals
WCF Fundamentals
 
WCF Introduction
WCF IntroductionWCF Introduction
WCF Introduction
 
WCF
WCFWCF
WCF
 
WCF
WCFWCF
WCF
 
Introduction to WCF
Introduction to WCFIntroduction to WCF
Introduction to WCF
 
WCF for begineers
WCF  for begineersWCF  for begineers
WCF for begineers
 
Windows Communication Foundation (WCF) Best Practices
Windows Communication Foundation (WCF) Best PracticesWindows Communication Foundation (WCF) Best Practices
Windows Communication Foundation (WCF) Best Practices
 
Windows Communication Foundation (WCF) Service
Windows Communication Foundation (WCF) ServiceWindows Communication Foundation (WCF) Service
Windows Communication Foundation (WCF) Service
 
Session 1: The SOAP Story
Session 1: The SOAP StorySession 1: The SOAP Story
Session 1: The SOAP Story
 
1. WCF Services - Exam 70-487
1. WCF Services - Exam 70-4871. WCF Services - Exam 70-487
1. WCF Services - Exam 70-487
 
Wcf
Wcf Wcf
Wcf
 
Service Oriented Development With Windows Communication Foundation 2003
Service Oriented Development With Windows Communication Foundation 2003Service Oriented Development With Windows Communication Foundation 2003
Service Oriented Development With Windows Communication Foundation 2003
 
Web services, WCF services and Multi Threading with Windows Forms
Web services, WCF services and Multi Threading with Windows FormsWeb services, WCF services and Multi Threading with Windows Forms
Web services, WCF services and Multi Threading with Windows Forms
 
Web services
Web servicesWeb services
Web services
 
Overview of Windows Vista Devices and Windows Communication Foundation (WCF)
Overview of Windows Vista Devices and Windows Communication Foundation (WCF)Overview of Windows Vista Devices and Windows Communication Foundation (WCF)
Overview of Windows Vista Devices and Windows Communication Foundation (WCF)
 
Web Services - Architecture and SOAP (part 1)
Web Services - Architecture and SOAP (part 1)Web Services - Architecture and SOAP (part 1)
Web Services - Architecture and SOAP (part 1)
 

Andere mochten auch

MSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingMSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingPeter R. Egli
 
Message Oriented Middleware (MOM)
Message Oriented Middleware (MOM)Message Oriented Middleware (MOM)
Message Oriented Middleware (MOM)drewenut
 
Message Oriented Architecture using NServiceBus
Message Oriented Architecture using NServiceBusMessage Oriented Architecture using NServiceBus
Message Oriented Architecture using NServiceBusLars-Erik Kindblad
 
Architecture of message oriented middleware
Architecture of message oriented middlewareArchitecture of message oriented middleware
Architecture of message oriented middlewareLikan Patra
 
Middleware and Middleware in distributed application
Middleware and Middleware in distributed applicationMiddleware and Middleware in distributed application
Middleware and Middleware in distributed applicationRishikese MR
 
MOM - Message Oriented Middleware
MOM - Message Oriented MiddlewareMOM - Message Oriented Middleware
MOM - Message Oriented MiddlewarePeter R. Egli
 
Unit 1 architecture of distributed systems
Unit 1 architecture of distributed systemsUnit 1 architecture of distributed systems
Unit 1 architecture of distributed systemskaran2190
 

Andere mochten auch (9)

Windows Communication Foundation
Windows Communication FoundationWindows Communication Foundation
Windows Communication Foundation
 
Message oriented middleware
Message oriented middlewareMessage oriented middleware
Message oriented middleware
 
MSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingMSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message Queueing
 
Message Oriented Middleware (MOM)
Message Oriented Middleware (MOM)Message Oriented Middleware (MOM)
Message Oriented Middleware (MOM)
 
Message Oriented Architecture using NServiceBus
Message Oriented Architecture using NServiceBusMessage Oriented Architecture using NServiceBus
Message Oriented Architecture using NServiceBus
 
Architecture of message oriented middleware
Architecture of message oriented middlewareArchitecture of message oriented middleware
Architecture of message oriented middleware
 
Middleware and Middleware in distributed application
Middleware and Middleware in distributed applicationMiddleware and Middleware in distributed application
Middleware and Middleware in distributed application
 
MOM - Message Oriented Middleware
MOM - Message Oriented MiddlewareMOM - Message Oriented Middleware
MOM - Message Oriented Middleware
 
Unit 1 architecture of distributed systems
Unit 1 architecture of distributed systemsUnit 1 architecture of distributed systems
Unit 1 architecture of distributed systems
 

Ähnlich wie introduction to Windows Comunication Foundation

A presentation on WCF & REST
A presentation on WCF & RESTA presentation on WCF & REST
A presentation on WCF & RESTSanthu Rao
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorialAbhi Arya
 
Understanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaUnderstanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaJignesh Aakoliya
 
Complete Architecture and Development Guide To Windows Communication Foundati...
Complete Architecture and Development Guide To Windows Communication Foundati...Complete Architecture and Development Guide To Windows Communication Foundati...
Complete Architecture and Development Guide To Windows Communication Foundati...Abdul Khan
 
Top wcf interview questions
Top wcf interview questionsTop wcf interview questions
Top wcf interview questionstongdang
 
WCF and WF in Framework 3.5
WCF and WF in Framework 3.5WCF and WF in Framework 3.5
WCF and WF in Framework 3.5ukdpe
 
WINDOWS COMMUNICATION FOUNDATION
WINDOWS COMMUNICATION FOUNDATIONWINDOWS COMMUNICATION FOUNDATION
WINDOWS COMMUNICATION FOUNDATIONDeepika Chaudhary
 
Basics of WCF and its Security
Basics of WCF and its SecurityBasics of WCF and its Security
Basics of WCF and its SecurityMindfire Solutions
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITCarol McDonald
 
Bee brief-intro-q42016
Bee brief-intro-q42016Bee brief-intro-q42016
Bee brief-intro-q42016wahyu prayudo
 
Introduction To Dot Net Siddhesh
Introduction To Dot Net SiddheshIntroduction To Dot Net Siddhesh
Introduction To Dot Net SiddheshSiddhesh Bhobe
 
Consul: Service Mesh for Microservices
Consul: Service Mesh for MicroservicesConsul: Service Mesh for Microservices
Consul: Service Mesh for MicroservicesArmonDadgar
 
Wcf best practice
Wcf best practiceWcf best practice
Wcf best practiceYu GUAN
 
Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...
Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...
Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...Jason Townsend, MBA
 

Ähnlich wie introduction to Windows Comunication Foundation (20)

A presentation on WCF & REST
A presentation on WCF & RESTA presentation on WCF & REST
A presentation on WCF & REST
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorial
 
07 advanced topics
07 advanced topics07 advanced topics
07 advanced topics
 
Understanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaUnderstanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company india
 
Complete Architecture and Development Guide To Windows Communication Foundati...
Complete Architecture and Development Guide To Windows Communication Foundati...Complete Architecture and Development Guide To Windows Communication Foundati...
Complete Architecture and Development Guide To Windows Communication Foundati...
 
Wcf faq
Wcf faqWcf faq
Wcf faq
 
Top wcf interview questions
Top wcf interview questionsTop wcf interview questions
Top wcf interview questions
 
WCF 4 Overview
WCF 4 OverviewWCF 4 Overview
WCF 4 Overview
 
WCF and WF in Framework 3.5
WCF and WF in Framework 3.5WCF and WF in Framework 3.5
WCF and WF in Framework 3.5
 
WINDOWS COMMUNICATION FOUNDATION
WINDOWS COMMUNICATION FOUNDATIONWINDOWS COMMUNICATION FOUNDATION
WINDOWS COMMUNICATION FOUNDATION
 
Basics of WCF and its Security
Basics of WCF and its SecurityBasics of WCF and its Security
Basics of WCF and its Security
 
OneTeam Media Server
OneTeam Media ServerOneTeam Media Server
OneTeam Media Server
 
Web services
Web servicesWeb services
Web services
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSIT
 
Bee brief-intro-q42016
Bee brief-intro-q42016Bee brief-intro-q42016
Bee brief-intro-q42016
 
Introduction To Dot Net Siddhesh
Introduction To Dot Net SiddheshIntroduction To Dot Net Siddhesh
Introduction To Dot Net Siddhesh
 
Consul: Service Mesh for Microservices
Consul: Service Mesh for MicroservicesConsul: Service Mesh for Microservices
Consul: Service Mesh for Microservices
 
SOA and web services
SOA and web servicesSOA and web services
SOA and web services
 
Wcf best practice
Wcf best practiceWcf best practice
Wcf best practice
 
Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...
Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...
Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...
 

Kürzlich hochgeladen

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Kürzlich hochgeladen (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

introduction to Windows Comunication Foundation

  • 1.  
  • 3.
  • 4. .NET At The Core
  • 5. Windows Communication Foundation The Unified Framework For Rapidly Building Service-Oriented Applications
  • 6.
  • 7. Unified Programming Model Interop with other platforms ASMX Attribute- Based Programming Enterprise Services WS-* Protocol Support WSE Message- Oriented Programming System.Messaging Extensibility Location transparency .NET Remoting
  • 8. WS-* Protocol Support XML Messaging Security Transactions Reliable Messaging Metadata
  • 11.
  • 12. Four Tenets of Service Orientation SERVICE ORIENTATION Compatibility Based On Policy Share Schema & Contract, Not Class Services Are Autonomous Boundaries Are Explicit
  • 13.
  • 14.
  • 16.
  • 17.
  • 18. Callers and Services Caller Service
  • 19. Endpoints Caller Service Endpoint Endpoint Endpoint Endpoint
  • 20. Address, Binding, Contract Service Caller C B A C B A A B C Address Where? Contract What? Binding How? C B A
  • 21. Creating Endpoints Service Service Host Caller Proxy or ChannelFactory A B C C B A C B A C B A
  • 22. Exposing & Configuring Endpoints proxy.cs Caller app/web.config GetMetadata WSDL Service ? C B A C B A C B A C B A C B A C B A
  • 24.
  • 25.
  • 26. Service Contract [ServiceContract] public interface ICalculator { [OperationContract] int DoMath(int a, int b, string op); }
  • 27. Service Contract An Opt-In Model [ServiceContract] public interface ICalculator { [OperationContract] int DoMath(int a, int b, string op); // Not exposed as part of the external contract :-) void MethodRequiredForImplementation(bool b); }
  • 28. Operations Types Message DoXmlMath( Message m); Untyped (“Universal”) MathResponse DoMsgMath( MathRequest msg); int DoParamsMath( int a, int b, string op ); Typed Message Parameterized Operations (shorthand for TM)
  • 29. Service Contract: Names [ServiceContract( Namespace =&quot;http://TechEd.WCF.Intro&quot;)] public interface IGreetings { [OperationContract( Name =“SayHello&quot;, Action =&quot;http://TechEd.WCF.Intro/HelloRequest&quot;, ReplyAction =&quot;http://TechEd.WCF.Intro/HelloResponse&quot;)] string Greet(string name); [OperationContractAttribute( Action = &quot;*&quot; )] void UnrecognizedMessageHandler( Message msg ); } class GreetingService : IGreetings { public string Greet(string name) { return “Hello, &quot; + name; } public void UnrecognizedMessageHandler(Message msg) { Console.WriteLine(&quot;Unrecognized message: &quot; + msg.ToString()); } }
  • 30.
  • 31. Service Contract: OneWay [ServiceContract] public interface IOneWayCalculator { [OperationContract( IsOneWay=true )] void DoMath(MathRequest request); }
  • 32. Service Contract: Duplex [ServiceContract(SessionMode=SessionMode.Required, CallbackContract=typeof(ICalculator Results ) ] public interface ICalculatorProblems { [OperationContract(IsOneWay=true)] void DoMath(MathRequest request); } public interface ICalculatorResults { [OperationContract(IsOneWay=true)] void DisplayResults(MathResponse response); }
  • 33. Service Contract: Faults t ry { return n1 / n2; } catch (DivideByZeroException e) { MyMathFault f = new MyMathFault (n1, n2); FaultReason r = new FaultReason(&quot;Divide By Zero&quot;); throw new Fault Exception < MyMathFault >( f, r ); } [ServiceContract(Session=true)] public interface ICalculator { [OperationContract] [FaultContract(typeof( MyMathFault ))] int DoMath(int a, int b, string op); }
  • 34. Service Contract: Versioning [ServiceContract] public interface ICalculator2 : ICalculator { [OperationContract(IsOneWay=true)] void SolveAndStoreProblem (ComplexProblem p); }
  • 35. Service Contract: Streams [ServiceContract ] public interface IStreamCalculator { [OperationContract] Stream Fibonacci(int iterations); }
  • 36. Data Contract [DataContract] public enum Position { [ EnumMember ] Employee, [ EnumMember ] Manager, [ EnumMember( Value = “ Vendor&quot; ) ] Contractor, NotASerializableEnumeration }
  • 37. Data Contract: Names [DataContract( Name=“Complex”, Namespace=“http://BigMath.Samples” )] public class ComplexNumber { [DataMember( Name=“RealPart” )] public double Real = 0.0D; [DataMember( Name=“ImaginaryPart” )] public double Imaginary = 0.0D; public ComplexNumber(double r, double i) { this.Real = r; this.Imaginary = i; } }
  • 38. Data Contract: Enumerations [DataContract] public enum Position { [EnumMember] Employee, [EnumMember] Manager, [EnumMember(Value = “Vendor&quot;)] Contractor, NotASerializableEnumeration }
  • 39. Message Contract [MessageContract] public class ComplexProblem { [MessageHeader(Name=&quot;Op&quot;, MustUnderstand=true)] public string operation; [MessageBodyMember] public ComplexNumber n1; [MessageBodyMember] public ComplexNumber n2; [MessageBodyMember] public ComplexNumber solution; // Constructors… }
  • 40. Mapping Contracts (1/2) [ MessageContract ] public class MyRequest { [MessageHeader] public int Amount; [MessageBody] public ItemInfo Info; } [ DataContract ] public class ItemInfo { [DataMember] public int ID; [DataMember] public double Cost; [DataMember] public string Name; } wsdl:message wsdl:part xsd:element
  • 41. Mapping Contracts (2/2) [ ServiceContract ] public interface MyContract { [OperationContract] MyReply MyOp(MyRequest request); [OperationContract] void MyOp2(MyRequest2 request); } wsdl:portType wsdl:operation
  • 42.
  • 43. Bindings & Binding Elements Transport IPC MSMQ Custom TCP HTTP Protocol Encoders .NET TX Custom Security Reliability Binding HTTP TX Security Reliability Text Text Binary Custom TCP Binary
  • 44.
  • 45. System-Provided Bindings N = None | T = Transport | M = Message | B = Both | RS = Reliable Sessions Binding Interop Security Session TX Duplex BasicHttpBinding BP 1.1 N, T N N n/a WSHttpBinding WS M , T, X N , T, RS N , Yes n/a WSDualHttpBinding WS M RS N , Yes Yes WSFederationBinding Federation M N , RS N , Yes No NetTcpBinding .NET T , M T ,RS N , Yes Yes NetNamedPipeBinding .NET T T , N N , Yes Yes NetPeerTcpBinding Peer T N N Yes NetMsmqBinding .NET T , M, X N N , Yes No MsmqIntegrationBinding MSMQ T N N , Yes n/a
  • 46. Binding in Config <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?> <configuration> <system.serviceModel> <services> <service serviceType=&quot;CalculatorService&quot;> <endpoint address=&quot;Calculator&quot; bindingSectionName=&quot;basicProfileBinding&quot; contractType=&quot;ICalculator&quot; /> </service> </services> </system.serviceModel> </configuration>
  • 47. Configuring Bindings <endpoint address=&quot;Calculator&quot; bindingSectionName=&quot; basic Http Binding &quot; bindingConfiguration=&quot; UsernameBinding &quot; contractType=&quot;ICalculator&quot; /> <bindings> <basicHttpBinding> <binding name=&quot; UsernameBinding &quot; messageEncoding=&quot;Mtom&quot;> <security mode=&quot;Message&quot;> <message clientCredentialType=&quot;UserName&quot;/> </security> </binding> </basicHttpBinding> < /bindings>
  • 48. Custom Bindings <bindings> <customBinding> <customBinding> <binding name=&quot;ReliableTCP&quot;> <reliableSession inactivityTimeout=&quot;0:0:5“ ordered=&quot;true&quot;/> <binaryMessageEncoding/> <tcpTransport transferMode=&quot;Buffered&quot;/> </binding> </customBinding> </customBinding> </bindings>
  • 49. Choosing Bindings Any Protocol Any Binding Any Binding WCF WCF MSMQ WCF COM+/ES WCF MSMQ Protocol WS-* Protocols MSMQ Binding Moniker ASMX/WSE3 WCF WS-* Protocols Http/WS Binding Other Platform WCF WS-* Protocols Http/WS Binding
  • 50.
  • 51.
  • 52. Behaviors Client-Side Behaviors Service-Side Behaviors Service Caller Be Be C B A C B A A B C C B A
  • 53.
  • 54. Example: Security Service Client Be Be Bindings Move Claims in Messages Behaviors Implement Security Gates Behaviors Provide Credentials C B A C B A A B C C B A
  • 55. Example: Transactions Service Caller Be Bindings Flow Transactions Behaviors AutoEnlist and AutoComplete C B A C B A A B C C B A
  • 56. Anti-Example: Reliable Sessions Service Caller Bindings provide Session and Guarantees C B A C B A A B C C B A
  • 57.
  • 58. Features Summary Address Binding Behavior Contract HTTP Transport TCP Transport NamedPipe Transport MSMQ Transport Custom Transport WS-Security Protocol WS-RM Protocol WS-AT Protocol Duplex Channel Custom Protocol http://... net.tcp://... net.pipe://... net.msmq://... xxx://... Throttling Behavior Metadata Behavior Error Behavior Custom Behavior Instancing Behavior Concurrency Behavior Transaction Behavior Security Behavior Request/ Response One-Way Duplex net.p2p://... Peer Transport Externally visible, per-endpoint Opaque, per-service, endpoint, or op
  • 59. WCF Application “Architecture” Channels Transport Channels (IPC, HTTP, TCP…) Reliability Message Encoder Security Hosting Environments WAS IIS .exe Windows Service DllHost Messaging Services Queuing Routing Eventing Discovery Service Model Application Instance Manager Context Manager Type Integration Service Methods Declarative Behaviors Transacted Methods
  • 60.
  • 61.