SlideShare a Scribd company logo
In this session, you will learn to:
Identify WCF
Explore the programming model of WCF
Objectives
WCF is a unified programming model for developing
service-oriented applications.
It combines the features of all the distributed technologies,
such as COM+ services, .NET Remoting, and Web
services.
It enables you to build a secure, reliable, and robust
application.
It enables two applications to communicate across platforms
in a distributed environment.
Identifying WCF
To understand the architecture of WCF, you should be
aware of the following fundamentals of WCF:
Unification: WCF enhances the development of distributed
applications and increases developer’s productivity by unifying
the following technologies:
COM+ services
.NET Remoting
Web services
Web Services Enhancements (WSE)
Microsoft Message Queuing
Interoperability: WCF enables two applications built on the
same or different platforms to communicate with each other
within or across a network.
Fundamentals of WCF
Service orientation: WCF provides a highly productive
programming model for building distributed systems that
involve developing loosely-coupled services.
The following figure illustrates the fundamentals of WCF.
Fundamentals of WCF (Contd.)
The following figure illustrates the architecture of WCF.
Architecture of WCF
Architecture of WCF (Contd.)
The WCF architecture contains the following layers:
The contract layer: It contains the various types of contracts,
policies, and bindings used in WCF. The various types of
contracts present in the contract layer are:
The data contract
The message contract
The service contract
Architecture of WCF (Contd.)
The service runtime layer: It specifies how the service will
behave when it runs or executes. This layer contains the
various types of runtime behaviors of the service. These
runtime behaviors are:
Throttling behavior
Error behavior
Metadata behavior
Instance behavior
Message inspection
Transaction behavior
Dispatch behavior
Concurrency behavior
Parameter filtering
Architecture of WCF (Contd.)
The messaging layer: It consists of channels through which a
message is processed and transported to a client accessing
the service. This layer consists of two types of channels:
Transport channels
Protocol channels
The activation and hosting layer: It supports the execution of
services in different environments, such as Windows services,
IIS, and Windows Activation Service (WAS). A WCF service
can be hosted in various ways. These ways are:
Self-hosting
IIS
Windows service
WAS
Exploring the Programming Model of WCF
All communication with a WCF service occurs through the
endpoints of the service.
An endpoint of a WCF service acts as a gateway for
communicating with other applications.
It is composed of an address, a binding, and a contract
known as the ABC of endpoint, as shown in the following
figure.
The address of a WCF service specifies the location where
the service resides.
It is represented in the form of a URL that defines:
The protocol to be used for sending and receiving messages.
The name of the system where the service runs.
The port number at which the service listens to the client
requests.
The path where the service resides and the name of the
service.
The following code snippet shows how you can specify the
address of a WCF service:
address="http://MyComputer:3577/CarDetailsWCFService
/Service.svc"
Address
It describes how a WCF service communicates with a client
application.
It specifies the communication details required to connect to
the endpoint of a WCF service.
It consists of the message encoder and protocol binding
element.
WCF provides the following types of bindings to enable a
client application to communicate with a WCF service:
basicHttpBinding
wsHttpBinding
netTcpBinding
netNamedPipeBinding
netMsmqBinding
netPeerTcpBinding
Binding
It exposes the interfaces, classes, methods, and variables
of a WCF service to enable client applications to access
and use them.
A WCF service may contain the following types of contracts:
Service contract
Operation contract
Data contract
Message contract
Fault contract
Contract
Service Contract:
Acts as an entry point to access a WCF service.
Is implemented as an interface.
Is defined by declaring the [ServiceContract] attribute in a
WCF service, as shown in the following code snippet:
[ServiceContract]
public interface IService
{
}
Contract (Contd.)
Operation Contract:
Exposes the operations that a service can perform.
Defines the methods of a WCF service and the parameters
and return types of the methods.
Is defined by declaring the [OperationContract] attribute
in the WCF service, as shown in the following code snippet:
[ServiceContract]
public interface IService
{
[OperationContract]
DataSet GetDetails(int Employee_ID);
}
Contract (Contd.)
Data Contract:
Is used to expose user-defined data types in a WCF service.
Serializes the user-defined data types in a standard format
(XML).
Is defined by using the [DataContract] attribute in the
WCF service, as shown in the following code snippet:
[DataContract]
public class Employees
{ [DataMember]
public int emp_id;
[DataMember]
public int emp_name;
}
Contract (Contd.)
Message Contract:
Describes the structure of a message exchanged between a
WCF service and a client application.
Enables you to inspect and control the information contained in
a message.
Is defined by using the [MessageContract],
[MessageBodyMember], and [MessageHeader]attributes,
as shown in the following code snippet:
[MessageContract]
public class StoreMessage
{
[MessageHeader]
public DateTime CurrentTime;
[MessageBodyMember]
public Employees emp_id; }
Contract (Contd.)
Fault Contract:
Enables you to send a customized error message to a client by
creating a user-defined class.
Enables you to control the situation when a WCF service
encounters an error.
Contract (Contd.)
Is defined by using the [FaultContract] attribute, as shown
in the following code snippet:
[ServiceContract]
public interface IService
{
[OperationContract]
[FaultContract(typeof(SampleFaultException))]
DataSet GetDetails(int Employee_ID);
}
[DataContract]
public class SampleFaultException
{
[DataMember]
public string errorMessage;
}
Contract (Contd.)
Problem Statement:
Luxury Drive is using an XML Web service that provides the
details about the various models of the cars manufactured by
the company. The Web service is used by the company’s call
center and the distributors. The call center employees use a
client application developed in .NET to access the Web
service. However, the distributors use various applications
having different platforms to access the Web service.
The management at Luxury Drive wants their Web service to
be such that it can accommodate features such as reliable
messaging, transactions, and security in future. The
management has conveyed the same to the developers.
The developers know that they can implement all these
features in the existing XML Web service. However, it would be
difficult because each of these features is provided by different
technologies and merging all these technologies is a time-
consuming and complex task.
Activity 5.1: Creating a WCF Service
Therefore, the developers decided to create the Web service
by using WCF because WCF is the unification of all these
technologies and provides all the required features. You, as a
distributed application developer, have to create a WCF
service that provides the details about the various models of
the cars manufactured by the company.
Prerequisite: You need to use the LuxuryDrive database for
this activity. Ask your faculty to provide you with the database
and the QueryCarDetailsClientApp client application.
Activity 5.1: Creating a WCF Service (Contd.)
Solution:
To create the required WCF service, you need to perform the
following tasks:
1. Create a WCF service.
2. Verify the WCF service.
Activity 5.1: Creating a WCF Service (Contd.)
In this session, you learned that:
WCF is a unified programming model for building
service-oriented applications. It combines the features of all the
distributed technologies, such as:
COM+ services
.NET Remoting
Web services
The fundamentals of WCF are:
Unification
Interoperability
Service orientation
The layers of the WCF architecture are:
Contract
Service runtime
Messaging
Activation and hosting
Summary
An endpoint of a WCF service acts as a gateway for
communicating with other applications.
An endpoint is composed of:
Address
Binding
Contract
An address of the service specifies the location where the
service resides.
Binding describes how a WCF service communicates with a
client application.
Summary (Contd.)
Some of the bindings provided by WCF are:
basicHttpBinding
wsHttpBinding
netTcpBinding
netNamedPipeBinding
netMsmqBinding
netPeerTcpBinding
Contracts specify the content of a message, such as methods
and variables and the functionality provided by a WCF service.
The various types of contracts in a WCF service are:
Service contract
Operation contract
Data contract
Message contract
Fault contract
Summary (Contd.)
Ad

More Related Content

What's hot (20)

J2ee
J2eeJ2ee
J2ee
Prince Soni
 
Mule edifact module
Mule edifact moduleMule edifact module
Mule edifact module
Son Nguyen
 
Unit 1st and 3rd notes of java
Unit 1st and 3rd notes of javaUnit 1st and 3rd notes of java
Unit 1st and 3rd notes of java
Niraj Bharambe
 
Moving from webservices to wcf services
Moving from webservices to wcf servicesMoving from webservices to wcf services
Moving from webservices to wcf services
Binu Bhasuran
 
Java unit 4_cs_notes
Java unit 4_cs_notesJava unit 4_cs_notes
Java unit 4_cs_notes
Niraj Bharambe
 
Example User Stories Specification for ReqView
Example User Stories Specification for ReqViewExample User Stories Specification for ReqView
Example User Stories Specification for ReqView
Eccam
 
Webapplication ppt prepared by krishna ballabh gupta
Webapplication ppt prepared by krishna ballabh guptaWebapplication ppt prepared by krishna ballabh gupta
Webapplication ppt prepared by krishna ballabh gupta
Shivalik college of engineering
 
J2 ee tutorial ejb
J2 ee tutorial ejbJ2 ee tutorial ejb
J2 ee tutorial ejb
Niraj Bharambe
 
Flex And Java Integration
Flex And Java IntegrationFlex And Java Integration
Flex And Java Integration
ravinxg
 
Overview of web services
Overview of web servicesOverview of web services
Overview of web services
People Strategists
 
ESM_ServiceLayer_DevGuide_1.0.pdf
ESM_ServiceLayer_DevGuide_1.0.pdfESM_ServiceLayer_DevGuide_1.0.pdf
ESM_ServiceLayer_DevGuide_1.0.pdf
Protect724v2
 
Chapter1
Chapter1Chapter1
Chapter1
guest9ccd0e
 
Flex And Java Integration
Flex And Java IntegrationFlex And Java Integration
Flex And Java Integration
rssharma
 
Web Service Presentation
Web Service PresentationWeb Service Presentation
Web Service Presentation
guest0df6b0
 
Chapter2 j2ee
Chapter2 j2eeChapter2 j2ee
Chapter2 j2ee
Jafar Nesargi
 
Asp.netrole
Asp.netroleAsp.netrole
Asp.netrole
mani bhushan
 
Flex And Ria
Flex And RiaFlex And Ria
Flex And Ria
ravinxg
 
Flex 3 - Introduction
Flex 3 - IntroductionFlex 3 - Introduction
Flex 3 - Introduction
rakhtar
 
Visual Studio 2010 IDE Enhancements - Alex Mackey, Readify
Visual Studio 2010 IDE Enhancements - Alex Mackey, ReadifyVisual Studio 2010 IDE Enhancements - Alex Mackey, Readify
Visual Studio 2010 IDE Enhancements - Alex Mackey, Readify
READIFY
 
]project-open[ Extensible Architecture
]project-open[ Extensible Architecture ]project-open[ Extensible Architecture
]project-open[ Extensible Architecture
Klaus Hofeditz
 
Mule edifact module
Mule edifact moduleMule edifact module
Mule edifact module
Son Nguyen
 
Unit 1st and 3rd notes of java
Unit 1st and 3rd notes of javaUnit 1st and 3rd notes of java
Unit 1st and 3rd notes of java
Niraj Bharambe
 
Moving from webservices to wcf services
Moving from webservices to wcf servicesMoving from webservices to wcf services
Moving from webservices to wcf services
Binu Bhasuran
 
Example User Stories Specification for ReqView
Example User Stories Specification for ReqViewExample User Stories Specification for ReqView
Example User Stories Specification for ReqView
Eccam
 
Flex And Java Integration
Flex And Java IntegrationFlex And Java Integration
Flex And Java Integration
ravinxg
 
ESM_ServiceLayer_DevGuide_1.0.pdf
ESM_ServiceLayer_DevGuide_1.0.pdfESM_ServiceLayer_DevGuide_1.0.pdf
ESM_ServiceLayer_DevGuide_1.0.pdf
Protect724v2
 
Flex And Java Integration
Flex And Java IntegrationFlex And Java Integration
Flex And Java Integration
rssharma
 
Web Service Presentation
Web Service PresentationWeb Service Presentation
Web Service Presentation
guest0df6b0
 
Flex And Ria
Flex And RiaFlex And Ria
Flex And Ria
ravinxg
 
Flex 3 - Introduction
Flex 3 - IntroductionFlex 3 - Introduction
Flex 3 - Introduction
rakhtar
 
Visual Studio 2010 IDE Enhancements - Alex Mackey, Readify
Visual Studio 2010 IDE Enhancements - Alex Mackey, ReadifyVisual Studio 2010 IDE Enhancements - Alex Mackey, Readify
Visual Studio 2010 IDE Enhancements - Alex Mackey, Readify
READIFY
 
]project-open[ Extensible Architecture
]project-open[ Extensible Architecture ]project-open[ Extensible Architecture
]project-open[ Extensible Architecture
Klaus Hofeditz
 

Viewers also liked (12)

C++ Unit_01
C++ Unit_01C++ Unit_01
C++ Unit_01
Prashanth Shivakumar
 
UML Unit 01
UML Unit 01UML Unit 01
UML Unit 01
Prashanth Shivakumar
 
A tour around san vicente de la barquera maria
A tour around san vicente de la barquera maria A tour around san vicente de la barquera maria
A tour around san vicente de la barquera maria
alumnos5matalinares
 
Data Structures and Algorithms Unit 01
Data Structures and Algorithms Unit 01Data Structures and Algorithms Unit 01
Data Structures and Algorithms Unit 01
Prashanth Shivakumar
 
RDBMS_Unit 01
RDBMS_Unit 01RDBMS_Unit 01
RDBMS_Unit 01
Prashanth Shivakumar
 
C programming unit 01
C programming unit 01C programming unit 01
C programming unit 01
Prashanth Shivakumar
 
J2ME Unit_01
J2ME Unit_01J2ME Unit_01
J2ME Unit_01
Prashanth Shivakumar
 
Web Component Development with Servlet and JSP Technologies Unit 01
Web Component Development with Servlet and JSP Technologies Unit 01Web Component Development with Servlet and JSP Technologies Unit 01
Web Component Development with Servlet and JSP Technologies Unit 01
Prashanth Shivakumar
 
Advanced excel unit 01
Advanced excel unit 01Advanced excel unit 01
Advanced excel unit 01
Prashanth Shivakumar
 
WPF (Windows Presentation Foundation Unit 01)
WPF (Windows Presentation Foundation Unit 01)WPF (Windows Presentation Foundation Unit 01)
WPF (Windows Presentation Foundation Unit 01)
Prashanth Shivakumar
 
VB.Net GUI Unit_01
VB.Net GUI Unit_01VB.Net GUI Unit_01
VB.Net GUI Unit_01
Prashanth Shivakumar
 
Ad

Similar to WCF (Windows Communication Foundation_Unit_01) (20)

WCF tutorial
WCF tutorialWCF tutorial
WCF tutorial
Abhi Arya
 
WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)
ipower softwares
 
WCFPresentation.ppt WCFPresentation.ppt WCFPresentation.ppt
WCFPresentation.ppt WCFPresentation.ppt WCFPresentation.pptWCFPresentation.ppt WCFPresentation.ppt WCFPresentation.ppt
WCFPresentation.ppt WCFPresentation.ppt WCFPresentation.ppt
yatakonakiran2
 
Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35
Subodh Pushpak
 
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
Advancio
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
Peter R. Egli
 
WFC #1
WFC #1WFC #1
WFC #1
Hoangminh Nguyen
 
Web services
Web servicesWeb services
Web services
aspnet123
 
Wcf development
Wcf developmentWcf development
Wcf development
Binu Bhasuran
 
1. WCF Services - Exam 70-487
1. WCF Services - Exam 70-4871. WCF Services - Exam 70-487
1. WCF Services - Exam 70-487
Bat Programmer
 
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
Jignesh Aakoliya
 
SOA & WCF
SOA & WCFSOA & WCF
SOA & WCF
Dev Raj Gautam
 
Top wcf interview questions
Top wcf interview questionsTop wcf interview questions
Top wcf interview questions
tongdang
 
Application integration framework & Adaptor ppt
Application integration framework & Adaptor pptApplication integration framework & Adaptor ppt
Application integration framework & Adaptor ppt
Aditya Negi
 
Session 1 Shanon Richards-Exposing Data Using WCF
Session 1 Shanon Richards-Exposing Data Using WCFSession 1 Shanon Richards-Exposing Data Using WCF
Session 1 Shanon Richards-Exposing Data Using WCF
Code Mastery
 
web programming
web programmingweb programming
web programming
sakthibalabalamuruga
 
Wcf
Wcf Wcf
Wcf
AriLis Holgubilla
 
Basics of WCF and its Security
Basics of WCF and its SecurityBasics of WCF and its Security
Basics of WCF and its Security
Mindfire Solutions
 
Web programming
Web programmingWeb programming
Web programming
sowfi
 
Advantage of WCF Over Web Services
Advantage of WCF Over Web ServicesAdvantage of WCF Over Web Services
Advantage of WCF Over Web Services
Siva Tharun Kola
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorial
Abhi Arya
 
WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)
ipower softwares
 
WCFPresentation.ppt WCFPresentation.ppt WCFPresentation.ppt
WCFPresentation.ppt WCFPresentation.ppt WCFPresentation.pptWCFPresentation.ppt WCFPresentation.ppt WCFPresentation.ppt
WCFPresentation.ppt WCFPresentation.ppt WCFPresentation.ppt
yatakonakiran2
 
Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35
Subodh Pushpak
 
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
Advancio
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
Peter R. Egli
 
Web services
Web servicesWeb services
Web services
aspnet123
 
1. WCF Services - Exam 70-487
1. WCF Services - Exam 70-4871. WCF Services - Exam 70-487
1. WCF Services - Exam 70-487
Bat Programmer
 
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
Jignesh Aakoliya
 
Top wcf interview questions
Top wcf interview questionsTop wcf interview questions
Top wcf interview questions
tongdang
 
Application integration framework & Adaptor ppt
Application integration framework & Adaptor pptApplication integration framework & Adaptor ppt
Application integration framework & Adaptor ppt
Aditya Negi
 
Session 1 Shanon Richards-Exposing Data Using WCF
Session 1 Shanon Richards-Exposing Data Using WCFSession 1 Shanon Richards-Exposing Data Using WCF
Session 1 Shanon Richards-Exposing Data Using WCF
Code Mastery
 
Basics of WCF and its Security
Basics of WCF and its SecurityBasics of WCF and its Security
Basics of WCF and its Security
Mindfire Solutions
 
Web programming
Web programmingWeb programming
Web programming
sowfi
 
Advantage of WCF Over Web Services
Advantage of WCF Over Web ServicesAdvantage of WCF Over Web Services
Advantage of WCF Over Web Services
Siva Tharun Kola
 
Ad

Recently uploaded (20)

Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 

WCF (Windows Communication Foundation_Unit_01)

  • 1. In this session, you will learn to: Identify WCF Explore the programming model of WCF Objectives
  • 2. WCF is a unified programming model for developing service-oriented applications. It combines the features of all the distributed technologies, such as COM+ services, .NET Remoting, and Web services. It enables you to build a secure, reliable, and robust application. It enables two applications to communicate across platforms in a distributed environment. Identifying WCF
  • 3. To understand the architecture of WCF, you should be aware of the following fundamentals of WCF: Unification: WCF enhances the development of distributed applications and increases developer’s productivity by unifying the following technologies: COM+ services .NET Remoting Web services Web Services Enhancements (WSE) Microsoft Message Queuing Interoperability: WCF enables two applications built on the same or different platforms to communicate with each other within or across a network. Fundamentals of WCF
  • 4. Service orientation: WCF provides a highly productive programming model for building distributed systems that involve developing loosely-coupled services. The following figure illustrates the fundamentals of WCF. Fundamentals of WCF (Contd.)
  • 5. The following figure illustrates the architecture of WCF. Architecture of WCF
  • 6. Architecture of WCF (Contd.) The WCF architecture contains the following layers: The contract layer: It contains the various types of contracts, policies, and bindings used in WCF. The various types of contracts present in the contract layer are: The data contract The message contract The service contract
  • 7. Architecture of WCF (Contd.) The service runtime layer: It specifies how the service will behave when it runs or executes. This layer contains the various types of runtime behaviors of the service. These runtime behaviors are: Throttling behavior Error behavior Metadata behavior Instance behavior Message inspection Transaction behavior Dispatch behavior Concurrency behavior Parameter filtering
  • 8. Architecture of WCF (Contd.) The messaging layer: It consists of channels through which a message is processed and transported to a client accessing the service. This layer consists of two types of channels: Transport channels Protocol channels The activation and hosting layer: It supports the execution of services in different environments, such as Windows services, IIS, and Windows Activation Service (WAS). A WCF service can be hosted in various ways. These ways are: Self-hosting IIS Windows service WAS
  • 9. Exploring the Programming Model of WCF All communication with a WCF service occurs through the endpoints of the service. An endpoint of a WCF service acts as a gateway for communicating with other applications. It is composed of an address, a binding, and a contract known as the ABC of endpoint, as shown in the following figure.
  • 10. The address of a WCF service specifies the location where the service resides. It is represented in the form of a URL that defines: The protocol to be used for sending and receiving messages. The name of the system where the service runs. The port number at which the service listens to the client requests. The path where the service resides and the name of the service. The following code snippet shows how you can specify the address of a WCF service: address="http://MyComputer:3577/CarDetailsWCFService /Service.svc" Address
  • 11. It describes how a WCF service communicates with a client application. It specifies the communication details required to connect to the endpoint of a WCF service. It consists of the message encoder and protocol binding element. WCF provides the following types of bindings to enable a client application to communicate with a WCF service: basicHttpBinding wsHttpBinding netTcpBinding netNamedPipeBinding netMsmqBinding netPeerTcpBinding Binding
  • 12. It exposes the interfaces, classes, methods, and variables of a WCF service to enable client applications to access and use them. A WCF service may contain the following types of contracts: Service contract Operation contract Data contract Message contract Fault contract Contract
  • 13. Service Contract: Acts as an entry point to access a WCF service. Is implemented as an interface. Is defined by declaring the [ServiceContract] attribute in a WCF service, as shown in the following code snippet: [ServiceContract] public interface IService { } Contract (Contd.)
  • 14. Operation Contract: Exposes the operations that a service can perform. Defines the methods of a WCF service and the parameters and return types of the methods. Is defined by declaring the [OperationContract] attribute in the WCF service, as shown in the following code snippet: [ServiceContract] public interface IService { [OperationContract] DataSet GetDetails(int Employee_ID); } Contract (Contd.)
  • 15. Data Contract: Is used to expose user-defined data types in a WCF service. Serializes the user-defined data types in a standard format (XML). Is defined by using the [DataContract] attribute in the WCF service, as shown in the following code snippet: [DataContract] public class Employees { [DataMember] public int emp_id; [DataMember] public int emp_name; } Contract (Contd.)
  • 16. Message Contract: Describes the structure of a message exchanged between a WCF service and a client application. Enables you to inspect and control the information contained in a message. Is defined by using the [MessageContract], [MessageBodyMember], and [MessageHeader]attributes, as shown in the following code snippet: [MessageContract] public class StoreMessage { [MessageHeader] public DateTime CurrentTime; [MessageBodyMember] public Employees emp_id; } Contract (Contd.)
  • 17. Fault Contract: Enables you to send a customized error message to a client by creating a user-defined class. Enables you to control the situation when a WCF service encounters an error. Contract (Contd.)
  • 18. Is defined by using the [FaultContract] attribute, as shown in the following code snippet: [ServiceContract] public interface IService { [OperationContract] [FaultContract(typeof(SampleFaultException))] DataSet GetDetails(int Employee_ID); } [DataContract] public class SampleFaultException { [DataMember] public string errorMessage; } Contract (Contd.)
  • 19. Problem Statement: Luxury Drive is using an XML Web service that provides the details about the various models of the cars manufactured by the company. The Web service is used by the company’s call center and the distributors. The call center employees use a client application developed in .NET to access the Web service. However, the distributors use various applications having different platforms to access the Web service. The management at Luxury Drive wants their Web service to be such that it can accommodate features such as reliable messaging, transactions, and security in future. The management has conveyed the same to the developers. The developers know that they can implement all these features in the existing XML Web service. However, it would be difficult because each of these features is provided by different technologies and merging all these technologies is a time- consuming and complex task. Activity 5.1: Creating a WCF Service
  • 20. Therefore, the developers decided to create the Web service by using WCF because WCF is the unification of all these technologies and provides all the required features. You, as a distributed application developer, have to create a WCF service that provides the details about the various models of the cars manufactured by the company. Prerequisite: You need to use the LuxuryDrive database for this activity. Ask your faculty to provide you with the database and the QueryCarDetailsClientApp client application. Activity 5.1: Creating a WCF Service (Contd.)
  • 21. Solution: To create the required WCF service, you need to perform the following tasks: 1. Create a WCF service. 2. Verify the WCF service. Activity 5.1: Creating a WCF Service (Contd.)
  • 22. In this session, you learned that: WCF is a unified programming model for building service-oriented applications. It combines the features of all the distributed technologies, such as: COM+ services .NET Remoting Web services The fundamentals of WCF are: Unification Interoperability Service orientation The layers of the WCF architecture are: Contract Service runtime Messaging Activation and hosting Summary
  • 23. An endpoint of a WCF service acts as a gateway for communicating with other applications. An endpoint is composed of: Address Binding Contract An address of the service specifies the location where the service resides. Binding describes how a WCF service communicates with a client application. Summary (Contd.)
  • 24. Some of the bindings provided by WCF are: basicHttpBinding wsHttpBinding netTcpBinding netNamedPipeBinding netMsmqBinding netPeerTcpBinding Contracts specify the content of a message, such as methods and variables and the functionality provided by a WCF service. The various types of contracts in a WCF service are: Service contract Operation contract Data contract Message contract Fault contract Summary (Contd.)