SlideShare une entreprise Scribd logo
1  sur  35
WINDOWS COMMUNICATION
     FOUNDATION

                  www.otssolutions.com
Agenda
 Introduction to WCF
    What is it? Why use it?
    Architecture
    Fundamentals and the ABCs of WCF
    Hosting

 Tooling Support
 Handling faults
Introduction to WCF
What is WCF?
 Stands for Windows Communication Foundation
 One of the 4 pillars of .NET 3.0
 Microsoft’s unified programming model (the service
model) for building Service-Oriented Applications
Different technology combined to form WCF.
WCF Architecture
SOA

 Service
    Small program interacted by well defines message
     exchanges
    Agile, Reliable, Stable, Interoperable, Secure
 Four Tenets
    Boundaries are Explicit
    Services are Autonomous
    Services share schema and contract, not class
    Service compatibility is based upon policy
SOA solutions used
SOA Use for Mobile platforms
Windows Communication Foundation
 WCF provides:
    an SDK for creating SOA
    a runtime for running Services on Windows
 Services send and receive messages
 All messages are SOAP messages
 WCF takes care of all the plumbing
Why use WCF?
 Interoperable and Standards based
    Supports WS-* protocols
 Unified Programming Model
    Unifies previous models like .NET Remoting,
     ASMX web services, COM+ etc
 Productive Programming Model
    Declarative
    Imperative
    Configuration based
WCF Value Proposition
   Simplicity
    Flexibility
    Maintainability
    Power
WCF: How does it work?
WCF End points
WCF Endpoints

Every service has
 Address
    Where the service is
 Binding
    How to talk to the service
 Contract
    What the service can do
Address
 Combination of transport, server name,
  port & path


 Transport is determined by the binding
 Examples
     http://localhost:8001
     net.tcp://localhost:8002/MyService
     net.pipe://localhost/MyPipe
     net.msmq://localhost/private/MyService
     net.msmq://localhost/MyService
Bindings
 Transport
    HTTP
    TCP
    MSMQ
 Message formats and encoding
    Plain text
    Binary
    Message Transmission Optimization Mechanism (MTOM)
 Communication security
      No security
      Transport security
      Message security
      Authenticating and authorizing callers
Out of the box Bindings
 BasicHttpBinding             NetTcpBinding
 WSHttpBinding                NetNamedPipeBinding
 WS2007HttpBinding            NetMsmqBinding
 WSDualHttpBinding            NetPeerTcpBinding
 WSFederationHttp             WebHttpBinding
  Binding                      MsmqIntegrationBinding
 WS2007FederationHttpBin
  ding
Contracts
 Service contracts
    Defines operations, communications and
     behaviours.
 Data contracts
    Defines data entities and parameter types.
 Fault contracts
    Defines error types
 Message contracts
    Defines message formats
Service Contracts
 [ServiceContract] – Defines a ‘set’ of operations
 [OperationContract] – Defines a single method
   [ServiceContract]
   public interface IService
   {
      [OperationContract]
      string GetData(int value);
   }

   public class ConcreteService : IService
   {
     public string GetData(int value)
     { ... }

       public string OtherMethod()
       { ... }
   }
Data Contracts
 [DataContract] – Specifies type as a data contract
 [DataMember] – Members that are part of contract


      [DataContract]
      public class CustomType
      {
          [DataMember]
          public bool MyFlag { get; set; }

          [DataMember]
          public string MyString { get; set; }

      }
Alternative – DataContract
 DataContract: created specifically for WCF to
  serialize types
    Attribute contains Name and Namespace
     properties
 DataMember is needed to specify which
  properties/fields will form part of the contract
    Contains EmitDefaultValue, IsRequired, Name,
     Order properties
Metadata Exchange
 Service can also expose endpoint for Metadata
  Exchange (MEX)
 It provides a mechanism for clients to find out
  about:
    Address of other end points
    Bindings that are used
    Contracts used – Service, Operation, Data, etc
Hosting
  IIS
     HTTP only
  WAS (Windows Activation Service)
     Can use any transport
     Vista and Windows Server 2008 only
  Self hosting
     Can use any transport
     Can be hosted within Console, WinForms, etc
       Applications
Tooling Support
Tooling Support
 Visual Studio
    Separate projects for WCF
    “Add Service reference” menu
    WCF Configuration Editor
    WCF Service Host
    WCF Test Tool
 SvcUtil – To generate proxies
 SvcTraceViewer – To view logs
Handling Faults
SOAP Faults
 Three main kinds of Exceptions can occur:
    Communication errors
    Unexpected error on the service
    Errors thrown by the service on purpose
 .NET Exceptions are technology specific
 All Exceptions come across the wire as SOAP
  Faults
Faults
 In WCF, SOAP faults are passed in as
  FaultException objects
 Rather than throwing Exceptions, services should
  throw FaultExceptions
 Or better still FaultException<T>
 Throwing FaultExceptions will not fault the proxy
  and the channel
FaultContracts
 Specifies what kind of Exceptions, an operation
  can throw



        [ServiceContract]
        public interface IEmployeeService
        {
           [OperationContract]
           [FaultContract(typeof(ValidationException))]
           public void AddEmployee(Employee e);
        }
Advantage
 Its made of a lot of different components, so you can
  create new components for security, transport,
  authentication.
 In WCF, there is no need to make much change in code
  for implementing the security model and changing the
  binding. Small changes in the configuration will make
  your requirements.
 Its faster than ASMX
 Its Interoperability, for java, and more.
 WCF is interoperable with other services when
  compared to .Net Remoting, where the client and
  service have to be .Net
 WCF services provide better reliability and security in
  compared to ASMX web services.
Disadvantage
 WCF is Microsoft's implementation of SOA and hence its
  APIs are solely controlled by MS which makes
  interoperability a bit difficult.

 To deploy WCF apps, need more underlying hardware
  resources on the platform on which the WCF
  applications will be running, since there is an additional
  layer of abstraction to deal with.
Summary
 WCF provides a runtime for creating Service Oriented Apps
 Provides a productive programming model. Takes care of:
    Messaging and Exchange formats
    All Plumbing: Transaction, Reliability, Security, etc
 Supports Declarative (via attributes), Imperative (via code)
  and Configuration based (via config files) programming model
 ABCs of Endpoints
    Address: Where to go?
    Binding: How to get there?
    Contract: What to do?
 Hosting
    IIS, WAS, Self-hosting
Thank You
            http://www.otssolutions.com/
USA
4433 Merlin              United kingdom                           India
 Way , Soquel            88 Wood Street
                          10th Floor London
                                                                  Gurgaon ( Haryana )
CA 95073
                                                                  795, Udyog Vihar, Phase-V
United States            EC2V 7RS
                                                                  Gurgaon(Haryana) India
Ph: +1 408 540 0001      Ph: +44 208 099 1660
                                                                  Ph: +91 124 4101350
                                                                  +91 124 4748100
Write to us at:
                                                                  Write to us at: sales@otssolutions.com
sales@otssolutions.com   Write to us at: sales@otssolutions.com
                                                                      http://www.otssolutions.com/

Contenu connexe

Tendances

Introduction to WCF
Introduction to WCFIntroduction to WCF
Introduction to WCFybbest
 
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUI
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUIAdvancio, Inc. Academy: Web Sevices, WCF & SOAPUI
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUIAdvancio
 
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...ecosio GmbH
 
Web service assignment
Web service assignmentWeb service assignment
Web service assignmentancymary1996
 
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
 
WebService-Java
WebService-JavaWebService-Java
WebService-Javahalwal
 
web service technologies
web service technologiesweb service technologies
web service technologiesYash Darak
 
Xml web services
Xml web servicesXml web services
Xml web servicesRaghu nath
 
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
 
Interoperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) OverviewInteroperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) OverviewJorgen Thelin
 
Web service Introduction
Web service IntroductionWeb service Introduction
Web service IntroductionMadhukar Kumar
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web servicesNeil Ghosh
 

Tendances (20)

Web service introduction 2
Web service introduction 2Web service introduction 2
Web service introduction 2
 
Introduction to WCF
Introduction to WCFIntroduction to WCF
Introduction to WCF
 
Web Services
Web ServicesWeb Services
Web Services
 
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUI
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUIAdvancio, Inc. Academy: Web Sevices, WCF & SOAPUI
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUI
 
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
 
Web service assignment
Web service assignmentWeb service assignment
Web service assignment
 
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
 
WebService-Java
WebService-JavaWebService-Java
WebService-Java
 
web service technologies
web service technologiesweb service technologies
web service technologies
 
Xml web services
Xml web servicesXml web services
Xml web services
 
Overview of web services
Overview of web servicesOverview of web services
Overview of web services
 
Webservices
WebservicesWebservices
Webservices
 
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 service
Web serviceWeb service
Web service
 
Web Service Basics and NWS Setup
Web Service  Basics and NWS SetupWeb Service  Basics and NWS Setup
Web Service Basics and NWS Setup
 
Interoperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) OverviewInteroperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) Overview
 
WCF Fundamentals
WCF Fundamentals WCF Fundamentals
WCF Fundamentals
 
Web service Introduction
Web service IntroductionWeb service Introduction
Web service Introduction
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
 
WCF
WCFWCF
WCF
 

En vedette

introduction to Windows Comunication Foundation
introduction to Windows Comunication Foundationintroduction to Windows Comunication Foundation
introduction to Windows Comunication Foundationredaxe12
 
Windows communication foundation (part2) jaliya udagedara
Windows communication foundation (part2) jaliya udagedaraWindows communication foundation (part2) jaliya udagedara
Windows communication foundation (part2) jaliya udagedaraJaliya Udagedara
 
Overview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB APIOverview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB APIPankaj Bajaj
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonAdnan Masood
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiTiago Knoch
 
ASP.NET MVC Core by Eduard Tomàs
ASP.NET MVC Core by Eduard TomàsASP.NET MVC Core by Eduard Tomàs
ASP.NET MVC Core by Eduard TomàsPlain Concepts
 

En vedette (7)

introduction to Windows Comunication Foundation
introduction to Windows Comunication Foundationintroduction to Windows Comunication Foundation
introduction to Windows Comunication Foundation
 
Windows communication foundation (part2) jaliya udagedara
Windows communication foundation (part2) jaliya udagedaraWindows communication foundation (part2) jaliya udagedara
Windows communication foundation (part2) jaliya udagedara
 
Overview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB APIOverview of Rest Service and ASP.NET WEB API
Overview of Rest Service and ASP.NET WEB API
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural Comparison
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
ASP.NET MVC Core by Eduard Tomàs
ASP.NET MVC Core by Eduard TomàsASP.NET MVC Core by Eduard Tomàs
ASP.NET MVC Core by Eduard Tomàs
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
 

Similaire à WINDOWS COMMUNICATION FOUNDATION

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
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorialAbhi Arya
 
Session 1: The SOAP Story
Session 1: The SOAP StorySession 1: The SOAP Story
Session 1: The SOAP Storyukdpe
 
Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35Subodh Pushpak
 
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
 
1. WCF Services - Exam 70-487
1. WCF Services - Exam 70-4871. WCF Services - Exam 70-487
1. WCF Services - Exam 70-487Bat Programmer
 
Unit 3-SOA Technologies
Unit 3-SOA TechnologiesUnit 3-SOA Technologies
Unit 3-SOA Technologiesssuser3a47cb
 
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 (Windows Communication Foundation_Unit_01)
WCF (Windows Communication Foundation_Unit_01)WCF (Windows Communication Foundation_Unit_01)
WCF (Windows Communication Foundation_Unit_01)Prashanth Shivakumar
 
Service Oriented Development With Windows Communication Foundation Tulsa Dnug
Service Oriented Development With Windows Communication Foundation   Tulsa DnugService Oriented Development With Windows Communication Foundation   Tulsa Dnug
Service Oriented Development With Windows Communication Foundation Tulsa DnugJason Townsend, MBA
 
Semantic Web Services (Standards, Monitoring, Testing and Security)
Semantic Web Services  (Standards, Monitoring, Testing and Security)Semantic Web Services  (Standards, Monitoring, Testing and Security)
Semantic Web Services (Standards, Monitoring, Testing and Security)Reza Gh
 
Application integration framework & Adaptor ppt
Application integration framework & Adaptor pptApplication integration framework & Adaptor ppt
Application integration framework & Adaptor pptAditya Negi
 
Basics of WCF and its Security
Basics of WCF and its SecurityBasics of WCF and its Security
Basics of WCF and its SecurityMindfire Solutions
 
Web services and SOA [Modified]
Web services and SOA [Modified]Web services and SOA [Modified]
Web services and SOA [Modified]Subin Sugunan
 

Similaire à WINDOWS COMMUNICATION FOUNDATION (20)

Wcf
Wcf Wcf
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)
Overview of Windows Vista Devices and Windows Communication Foundation (WCF)
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorial
 
Session 1: The SOAP Story
Session 1: The SOAP StorySession 1: The SOAP Story
Session 1: The SOAP Story
 
Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35
 
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...
 
1. WCF Services - Exam 70-487
1. WCF Services - Exam 70-4871. WCF Services - Exam 70-487
1. WCF Services - Exam 70-487
 
07 advanced topics
07 advanced topics07 advanced topics
07 advanced topics
 
Unit 3-SOA Technologies
Unit 3-SOA TechnologiesUnit 3-SOA Technologies
Unit 3-SOA Technologies
 
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...
 
Top wcf interview questions
Top wcf interview questionsTop wcf interview questions
Top wcf interview questions
 
WCF (Windows Communication Foundation_Unit_01)
WCF (Windows Communication Foundation_Unit_01)WCF (Windows Communication Foundation_Unit_01)
WCF (Windows Communication Foundation_Unit_01)
 
Service Oriented Development With Windows Communication Foundation Tulsa Dnug
Service Oriented Development With Windows Communication Foundation   Tulsa DnugService Oriented Development With Windows Communication Foundation   Tulsa Dnug
Service Oriented Development With Windows Communication Foundation Tulsa Dnug
 
Semantic Web Services (Standards, Monitoring, Testing and Security)
Semantic Web Services  (Standards, Monitoring, Testing and Security)Semantic Web Services  (Standards, Monitoring, Testing and Security)
Semantic Web Services (Standards, Monitoring, Testing and Security)
 
SOA and web services
SOA and web servicesSOA and web services
SOA and web services
 
Application integration framework & Adaptor ppt
Application integration framework & Adaptor pptApplication integration framework & Adaptor ppt
Application integration framework & Adaptor ppt
 
Basics of WCF and its Security
Basics of WCF and its SecurityBasics of WCF and its Security
Basics of WCF and its Security
 
Web services and SOA [Modified]
Web services and SOA [Modified]Web services and SOA [Modified]
Web services and SOA [Modified]
 
Net Services
Net ServicesNet Services
Net Services
 
Web services
Web servicesWeb services
Web services
 

Plus de Deepika Chaudhary

.NET Framework 4.0 – Changes & Benefits
.NET Framework 4.0 – Changes & Benefits .NET Framework 4.0 – Changes & Benefits
.NET Framework 4.0 – Changes & Benefits Deepika Chaudhary
 
Windows Presentation Foundation
Windows Presentation Foundation  Windows Presentation Foundation
Windows Presentation Foundation Deepika Chaudhary
 
Android™ application development
Android™ application developmentAndroid™ application development
Android™ application developmentDeepika Chaudhary
 
Cake php oops approach for php
Cake php  oops approach for phpCake php  oops approach for php
Cake php oops approach for phpDeepika Chaudhary
 
Creativity and-skill-to-java-app-development
Creativity and-skill-to-java-app-developmentCreativity and-skill-to-java-app-development
Creativity and-skill-to-java-app-developmentDeepika Chaudhary
 
Creativity and-skill-to-java-app-development
Creativity and-skill-to-java-app-developmentCreativity and-skill-to-java-app-development
Creativity and-skill-to-java-app-developmentDeepika Chaudhary
 
Java application-development-in-india
Java application-development-in-indiaJava application-development-in-india
Java application-development-in-indiaDeepika Chaudhary
 
Net application-development–business-growth-with-net
Net application-development–business-growth-with-netNet application-development–business-growth-with-net
Net application-development–business-growth-with-netDeepika Chaudhary
 
Hire Dedicated Java Developers
Hire Dedicated Java DevelopersHire Dedicated Java Developers
Hire Dedicated Java DevelopersDeepika Chaudhary
 
Java application-development
Java application-developmentJava application-development
Java application-developmentDeepika Chaudhary
 
Software development companies in india
Software development companies in indiaSoftware development companies in india
Software development companies in indiaDeepika Chaudhary
 
Java the reason behind its never ending demand
Java the reason behind its never ending demandJava the reason behind its never ending demand
Java the reason behind its never ending demandDeepika Chaudhary
 
Know all about android development
Know all about android developmentKnow all about android development
Know all about android developmentDeepika Chaudhary
 
OTS Solutions LLC Corporate presentation
OTS Solutions LLC Corporate presentationOTS Solutions LLC Corporate presentation
OTS Solutions LLC Corporate presentationDeepika Chaudhary
 
OTS Solutions LLC Corporate presentation
OTS Solutions LLC Corporate presentationOTS Solutions LLC Corporate presentation
OTS Solutions LLC Corporate presentationDeepika Chaudhary
 

Plus de Deepika Chaudhary (15)

.NET Framework 4.0 – Changes & Benefits
.NET Framework 4.0 – Changes & Benefits .NET Framework 4.0 – Changes & Benefits
.NET Framework 4.0 – Changes & Benefits
 
Windows Presentation Foundation
Windows Presentation Foundation  Windows Presentation Foundation
Windows Presentation Foundation
 
Android™ application development
Android™ application developmentAndroid™ application development
Android™ application development
 
Cake php oops approach for php
Cake php  oops approach for phpCake php  oops approach for php
Cake php oops approach for php
 
Creativity and-skill-to-java-app-development
Creativity and-skill-to-java-app-developmentCreativity and-skill-to-java-app-development
Creativity and-skill-to-java-app-development
 
Creativity and-skill-to-java-app-development
Creativity and-skill-to-java-app-developmentCreativity and-skill-to-java-app-development
Creativity and-skill-to-java-app-development
 
Java application-development-in-india
Java application-development-in-indiaJava application-development-in-india
Java application-development-in-india
 
Net application-development–business-growth-with-net
Net application-development–business-growth-with-netNet application-development–business-growth-with-net
Net application-development–business-growth-with-net
 
Hire Dedicated Java Developers
Hire Dedicated Java DevelopersHire Dedicated Java Developers
Hire Dedicated Java Developers
 
Java application-development
Java application-developmentJava application-development
Java application-development
 
Software development companies in india
Software development companies in indiaSoftware development companies in india
Software development companies in india
 
Java the reason behind its never ending demand
Java the reason behind its never ending demandJava the reason behind its never ending demand
Java the reason behind its never ending demand
 
Know all about android development
Know all about android developmentKnow all about android development
Know all about android development
 
OTS Solutions LLC Corporate presentation
OTS Solutions LLC Corporate presentationOTS Solutions LLC Corporate presentation
OTS Solutions LLC Corporate presentation
 
OTS Solutions LLC Corporate presentation
OTS Solutions LLC Corporate presentationOTS Solutions LLC Corporate presentation
OTS Solutions LLC Corporate presentation
 

Dernier

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 

Dernier (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 

WINDOWS COMMUNICATION FOUNDATION

  • 1. WINDOWS COMMUNICATION FOUNDATION www.otssolutions.com
  • 2. Agenda  Introduction to WCF  What is it? Why use it?  Architecture  Fundamentals and the ABCs of WCF  Hosting  Tooling Support  Handling faults
  • 4. What is WCF?  Stands for Windows Communication Foundation  One of the 4 pillars of .NET 3.0  Microsoft’s unified programming model (the service model) for building Service-Oriented Applications
  • 7. SOA  Service  Small program interacted by well defines message exchanges  Agile, Reliable, Stable, Interoperable, Secure  Four Tenets  Boundaries are Explicit  Services are Autonomous  Services share schema and contract, not class  Service compatibility is based upon policy
  • 9. SOA Use for Mobile platforms
  • 10. Windows Communication Foundation  WCF provides:  an SDK for creating SOA  a runtime for running Services on Windows  Services send and receive messages  All messages are SOAP messages  WCF takes care of all the plumbing
  • 11. Why use WCF?  Interoperable and Standards based  Supports WS-* protocols  Unified Programming Model  Unifies previous models like .NET Remoting, ASMX web services, COM+ etc  Productive Programming Model  Declarative  Imperative  Configuration based
  • 12. WCF Value Proposition  Simplicity  Flexibility  Maintainability  Power
  • 13. WCF: How does it work?
  • 15. WCF Endpoints Every service has  Address  Where the service is  Binding  How to talk to the service  Contract  What the service can do
  • 16. Address  Combination of transport, server name, port & path  Transport is determined by the binding  Examples http://localhost:8001 net.tcp://localhost:8002/MyService net.pipe://localhost/MyPipe net.msmq://localhost/private/MyService net.msmq://localhost/MyService
  • 17. Bindings  Transport  HTTP  TCP  MSMQ  Message formats and encoding  Plain text  Binary  Message Transmission Optimization Mechanism (MTOM)  Communication security  No security  Transport security  Message security  Authenticating and authorizing callers
  • 18. Out of the box Bindings  BasicHttpBinding  NetTcpBinding  WSHttpBinding  NetNamedPipeBinding  WS2007HttpBinding  NetMsmqBinding  WSDualHttpBinding  NetPeerTcpBinding  WSFederationHttp  WebHttpBinding Binding  MsmqIntegrationBinding  WS2007FederationHttpBin ding
  • 19. Contracts  Service contracts  Defines operations, communications and behaviours.  Data contracts  Defines data entities and parameter types.  Fault contracts  Defines error types  Message contracts  Defines message formats
  • 20. Service Contracts  [ServiceContract] – Defines a ‘set’ of operations  [OperationContract] – Defines a single method [ServiceContract] public interface IService { [OperationContract] string GetData(int value); } public class ConcreteService : IService { public string GetData(int value) { ... } public string OtherMethod() { ... } }
  • 21. Data Contracts  [DataContract] – Specifies type as a data contract  [DataMember] – Members that are part of contract [DataContract] public class CustomType { [DataMember] public bool MyFlag { get; set; } [DataMember] public string MyString { get; set; } }
  • 22. Alternative – DataContract  DataContract: created specifically for WCF to serialize types  Attribute contains Name and Namespace properties  DataMember is needed to specify which properties/fields will form part of the contract  Contains EmitDefaultValue, IsRequired, Name, Order properties
  • 23. Metadata Exchange  Service can also expose endpoint for Metadata Exchange (MEX)  It provides a mechanism for clients to find out about:  Address of other end points  Bindings that are used  Contracts used – Service, Operation, Data, etc
  • 24. Hosting  IIS  HTTP only  WAS (Windows Activation Service)  Can use any transport  Vista and Windows Server 2008 only  Self hosting  Can use any transport  Can be hosted within Console, WinForms, etc Applications
  • 26. Tooling Support  Visual Studio  Separate projects for WCF  “Add Service reference” menu  WCF Configuration Editor  WCF Service Host  WCF Test Tool  SvcUtil – To generate proxies  SvcTraceViewer – To view logs
  • 28. SOAP Faults  Three main kinds of Exceptions can occur:  Communication errors  Unexpected error on the service  Errors thrown by the service on purpose  .NET Exceptions are technology specific  All Exceptions come across the wire as SOAP Faults
  • 29. Faults  In WCF, SOAP faults are passed in as FaultException objects  Rather than throwing Exceptions, services should throw FaultExceptions  Or better still FaultException<T>  Throwing FaultExceptions will not fault the proxy and the channel
  • 30. FaultContracts  Specifies what kind of Exceptions, an operation can throw [ServiceContract] public interface IEmployeeService { [OperationContract] [FaultContract(typeof(ValidationException))] public void AddEmployee(Employee e); }
  • 31. Advantage  Its made of a lot of different components, so you can create new components for security, transport, authentication.  In WCF, there is no need to make much change in code for implementing the security model and changing the binding. Small changes in the configuration will make your requirements.  Its faster than ASMX  Its Interoperability, for java, and more.  WCF is interoperable with other services when compared to .Net Remoting, where the client and service have to be .Net  WCF services provide better reliability and security in compared to ASMX web services.
  • 32. Disadvantage  WCF is Microsoft's implementation of SOA and hence its APIs are solely controlled by MS which makes interoperability a bit difficult.  To deploy WCF apps, need more underlying hardware resources on the platform on which the WCF applications will be running, since there is an additional layer of abstraction to deal with.
  • 33. Summary  WCF provides a runtime for creating Service Oriented Apps  Provides a productive programming model. Takes care of:  Messaging and Exchange formats  All Plumbing: Transaction, Reliability, Security, etc  Supports Declarative (via attributes), Imperative (via code) and Configuration based (via config files) programming model  ABCs of Endpoints  Address: Where to go?  Binding: How to get there?  Contract: What to do?  Hosting  IIS, WAS, Self-hosting
  • 34. Thank You http://www.otssolutions.com/
  • 35. USA 4433 Merlin United kingdom India Way , Soquel 88 Wood Street 10th Floor London Gurgaon ( Haryana ) CA 95073 795, Udyog Vihar, Phase-V United States EC2V 7RS Gurgaon(Haryana) India Ph: +1 408 540 0001 Ph: +44 208 099 1660 Ph: +91 124 4101350 +91 124 4748100 Write to us at: Write to us at: sales@otssolutions.com sales@otssolutions.com Write to us at: sales@otssolutions.com http://www.otssolutions.com/

Notes de l'éditeur

  1. WCF combines many previous Microsoft messaging technologies together into a standard coding framework. A service is written as a logical piece of work and is then exposed using whichever method is most appropriate. This keeps the service logic and the technical transportation pieces of the service separate and reduces the complexity.
  2. There are numerous ways that a message can be formatted/sent/secured, this allows you to tailor your service for the compatibility/performance you require for your solution. Because there is such a large number of choices that can be made these have been packaged into ‘standard binding’ sets for easy use. A service can support multiple sets of bindings, however each must be on a separate address. The Client must use exactly the same binding as service otherwise they will not be able to communicate properly.
  3. We will talk about just the first three in this presentation. Message Contracts help in specifying the actual SOAP message and isn’t used as much as the other 3
  4. To expose a class and methods as a service you need to decorate them with metadata, this allows .NET to map this the CLR to WCF. A single Class can implement multiple ServiceContracts it just needs to implement multiple Interfaces. The methods exposed with [ OperationContract] can only use primitive or data contracts as parameters.
  5. To expose a class and methods as a service you need to decorate them with metadata, this allows .NET to map this the CLR to WCF. A single Class can implement multiple ServiceContracts it just needs to implement multiple Interfaces. The methods exposed with [ OperationContract] can only use primitive or data contracts as parameters.
  6. Self hosting can be done in any .NET application: WPF, Winforms, WF, console, windows service, etc. An advantage of hosting on IIS or WAS over self hosting is that the process needs to be running constantly with a self hosted solution, whereas one hosted on IIS or WAS isn’t launched until there is a client request.