SlideShare a Scribd company logo
WCFPresentation.ppt WCFPresentation.ppt WCFPresentation.ppt
Agenda
• .NET Framework 3.5 Overview
• Web Services Overview
• Remoting Overview
• WCF Overview
• Elements of WCF & WCF Architecture
• Different Types of WCF Services
• Creating your first WCF Service
• Service Endpoint Configurations
• Service and Data contracts
• Consuming your WCF Service from Clients
• Tools used in creating Proxies
.NET Framework 3.5
Overview
Web Services Overview
Windows Communication
Foundation (WCF)
• WCF is Microsoft’s unified programming model that
combines the best of .NET distributed systems
technologies such as:
- ASP.NET Web Services (ASMX)
- .NET Remoting (Remoting)
- Enterprise Services (COM+)
- Web Services Enhancements (WSE)
- Microsoft Message Queuing (MSMQ)
- Representational State Transfer (REST)
What WCF Provides?
• Unification of Microsoft’s Distributed Computing
Technologies
• Interoperability with Applications Built on Other
Technologies
• Interoperability with Other Web Services Platforms
• Interoperability with Microsoft’s Pre-WCF Technologies
• Explicit Support for Service-Oriented Development
• Framework for building services that process XML
messages
• Allows to transmit messages using different transport
protocols (such as HTTP, TCP, and MSMQ) and using
different XML representations (such as text, binary, or
MTOM)
WCF - Unified
Programming Model
WCF - Unified Programming Model
ABCs of Programming
WCF
WCF End Points
The Structure of an
Endpoint
Address:
The address uniquely identifies the endpoint and
tells potential consumers of the service where it is
located.
EndPoint usingwsHttpBinding
• <add
baseAddress="http://localhost:8550/YourNameSpace.You
rServiceCV/" />
Endpoint using netNamedPipeBinding
• <add
baseAddress="net.pipe://localhost/YourNameSpace.YourS
erviceCV/" />
WCF Bindings
Binding Configuration Element Description
BasicHttpBinding <basicHttpBinding> A binding that is suitable for communicating with WS-Basic
Profile conformant Web services, for example, ASP.NET Web
services (ASMX)-based services. This binding uses HTTP as
the transport and text/XML as the default message encoding.
WSHttpBinding <wsHttpBinding> A secure and interoperable binding that is suitable for non-
duplex service contracts.
WSDualHttpBinding <wsDualHttpBinding> A secure and interoperable binding that is suitable for duplex
service contracts or communication through SOAP
intermediaries.
WSFederationHttpBinding <wsFederationHttpBinding> A secure and interoperable binding that supports the WS-
Federation protocol that enables organizations that are in a
federation to efficiently authenticate and authorize users.
NetTcpBinding <netTcpBinding> A secure and optimized binding suitable for cross-machine
communication between WCF applications.
Bindings are used to specify the transport, encoding, and protocol details
required for clients and services to communicate with each other.
To generate the underlying wire representation of the endpoint, most of the
binding details must be agreed upon by the parties that are communicating.
WCF Bindings
Binding Configuration Element Description
NetMsmqBinding <netMsmqBinding> A queued binding that is suitable for cross-machine
communication between WCF applications.
NetPeerTcpBinding <netPeerTcpBinding> A binding that enables secure, multiple machine
communication.
MsmqIntegrationBinding <msmqIntegrationBinding> A binding that is suitable for cross-machine communication
between a WCF application and existing Message Queuing
applications.
BasicHttpContextBinding <basicHttpContextBinding> A binding that is suitable for communicating with WS-Basic
Profile conformant Web services that enables HTTP cookies
to be used to exchange context.
NetTcpContextBinding <netTcpContextBinding> A secure and optimized binding suitable for cross-machine
communication between WCF applications that enables SOAP
headers to be used to exchange context.
WebHttpBinding <webHttpBinding> A binding used to configure endpoints for WCF Web services
that are exposed through HTTP requests instead of SOAP
messages.
WSHttpContextBinding <wsHttpContextBinding> A secure and interoperable binding that is suitable for non-
duplex service contracts that enables SOAP headers to be
used to exchange context.
CustomBinding Developer decides Developer decides
Steps for Creating WCF
Services
• Design and Implement WCF Services
- [ServiceContract] & [ServiceBehavior]
- [OperationContract] & [OperationBehavior]
- [DataContract] & [DataMember]
- [MessageContract] & [MessageHeader] &
[MessageBodyMember]
- [FaultContract]
• Configure WCF Services
- web.config or app.config
- Endpoint details: Address, Binding & Contract
(SvcConfigEditor.exe)
ServiceContract
 Use the ServiceContract attribute on an interface
(or class) to define a service contract.
 ServiceContract combined with an endpoint and
address exposes the service to the client
 Service class will implement a ServiceContract –
Implementing the interface marked with
ServiceContract attribute
 Example:-
[ServiceContract]
public interface IMyFirstService
{
//TODO : Define your Operations here
}
OperationContract
 OperationContract attribute is used in the class
(or interface) methods to define the contract's
service operations
 OperationContract exposes the service operation
to the client
 All Service Operations (methods) to be exposed
to the clients should be marked with
OperationContract attribute
 Example:-
[ServiceContract]
public interface IMyFirstService
{
[OperationContract]
string GetData(int value);
}
DataContract &
DataMember
 Agreement between the client and the service
that describes the data to be exchanged
 DataContract Serializer to serialize and de-
serialize data
 Serialize and De-Serialize is nothing but
converting the data to and from xml
 In order to tell the serialization engine, we need
to use DataContract attribute as a prefix for the
class and DataMember attribute prefix for the
property(data member)
Demo:
Building WCF Service
• WCF Architecture:
http://msdn2.microsoft.com/en-us/library/aa4802
10.aspx
• Basic WCF Programming:
http://msdn2.microsoft.com/en-us/library/ms731
067.aspx
• WS-* Protocols: http://msdn2.microsoft.com/en-
us/library/ms951274.aspx
• WCF Bindings : http://msdn.microsoft.com/en-
us/magazine/cc163394.aspx
References
Questions

More Related Content

DOC
WCF tutorial
PPTX
1. WCF Services - Exam 70-487
PPT
Dot Net Training Wcf Dot Net35
PPTX
Windows communication foundation ii
PPS
WCF (Windows Communication Foundation_Unit_01)
PPT
Basics of WCF and its Security
PPT
Service Oriented Development With Windows Communication Foundation 2003
PPTX
WCF Fundamentals
WCF tutorial
1. WCF Services - Exam 70-487
Dot Net Training Wcf Dot Net35
Windows communication foundation ii
WCF (Windows Communication Foundation_Unit_01)
Basics of WCF and its Security
Service Oriented Development With Windows Communication Foundation 2003
WCF Fundamentals

Similar to WCFPresentation.ppt WCFPresentation.ppt WCFPresentation.ppt (20)

PDF
WCF Interview Questions By Scholarhat PDF
PPT
Session 1 Shanon Richards-Exposing Data Using WCF
PPT
Service Oriented Development With Windows Communication Foundation Tulsa Dnug
PPTX
A presentation on WCF & REST
PPT
Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...
PPTX
Windows Communication Foundation (WCF)
PPT
Windows Communication Foundation
PPTX
What's new in Wcf4
PPTX
Web service, wcf, web api
PDF
Beginning with wcf service
PPTX
WCjffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...
PDF
Wcf Overview
PPTX
web programming
PDF
Wcf development
DOCX
Top wcf interview questions
PPTX
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUI
PPTX
Lunch Learn - WCF Security
PPT
WCF Interview Questions By Scholarhat PDF
Session 1 Shanon Richards-Exposing Data Using WCF
Service Oriented Development With Windows Communication Foundation Tulsa Dnug
A presentation on WCF & REST
Tulsa Tech Fest2008 Service Oriented Development With Windows Communication F...
Windows Communication Foundation (WCF)
Windows Communication Foundation
What's new in Wcf4
Web service, wcf, web api
Beginning with wcf service
WCjffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...
Wcf Overview
web programming
Wcf development
Top wcf interview questions
Advancio, Inc. Academy: Web Sevices, WCF & SOAPUI
Lunch Learn - WCF Security
Ad

More from yatakonakiran2 (20)

PPTX
Operators in c-1.pptxOperators in c-1.pptx
PPTX
functions in c-1.pptxfunctions in c-1.pptx
PPTX
MULTITHREADING IN JAVAMULTITHREADING IN -1.pptx
PPTX
Java Flow Controls.pptxJava Flow Controls.pptxJava Flow Controls.pptx
PPTX
Data-Types-in-C-Programming.Programming.pptxProgramming.pptxpptx
PPTX
StringBuffer examples.pptxStringBuffer examples.pptxStringBuffer examples.pptx
PPTX
String and StringBufferString and StringBuffer e examples.pptx
PPTX
OOP_Java_Part2.pptxOOP_Java_Part1OOP_Java_Part1
PPTX
OOP_Java_Part1OOP_Java_Part1OOP_Java_Part1.pptx
PPTX
Java_Arrays_Presentation-2aaaaaaaaaa.pptx
PPTX
Java_Arrays_Paaaaaaaaaaresentation-1.pptx
PPT
Java Fundamentals.pptJava Fundamentals.ppt
PPTX
Operating_Systems_UNIT_Concept of an Operating System1.pptx
PPTX
array2.pptxarrays conceptsarrays conceptsarrays concepts
PPTX
array1.pptarrays conceptsarrays conceptsarrays concepts
PPTX
a21.pptxa24.pptxArrays122a24.pptxArrays111
PPTX
a1.pptxArrays1Arrays1Arrays1Arrays1Arrays1
PPTX
c2ppt.pptxslidenoteseceslidenoteseceslidenoteseceslidenoteseceslidenotesece
PPTX
c first pres.pptxslidenoteseceslidenoteseceslidenotesece
PPTX
Arrays-from-Basics-to-Advanced final.pptx
Operators in c-1.pptxOperators in c-1.pptx
functions in c-1.pptxfunctions in c-1.pptx
MULTITHREADING IN JAVAMULTITHREADING IN -1.pptx
Java Flow Controls.pptxJava Flow Controls.pptxJava Flow Controls.pptx
Data-Types-in-C-Programming.Programming.pptxProgramming.pptxpptx
StringBuffer examples.pptxStringBuffer examples.pptxStringBuffer examples.pptx
String and StringBufferString and StringBuffer e examples.pptx
OOP_Java_Part2.pptxOOP_Java_Part1OOP_Java_Part1
OOP_Java_Part1OOP_Java_Part1OOP_Java_Part1.pptx
Java_Arrays_Presentation-2aaaaaaaaaa.pptx
Java_Arrays_Paaaaaaaaaaresentation-1.pptx
Java Fundamentals.pptJava Fundamentals.ppt
Operating_Systems_UNIT_Concept of an Operating System1.pptx
array2.pptxarrays conceptsarrays conceptsarrays concepts
array1.pptarrays conceptsarrays conceptsarrays concepts
a21.pptxa24.pptxArrays122a24.pptxArrays111
a1.pptxArrays1Arrays1Arrays1Arrays1Arrays1
c2ppt.pptxslidenoteseceslidenoteseceslidenoteseceslidenoteseceslidenotesece
c first pres.pptxslidenoteseceslidenoteseceslidenotesece
Arrays-from-Basics-to-Advanced final.pptx
Ad

Recently uploaded (20)

PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Institutional Correction lecture only . . .
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Cell Types and Its function , kingdom of life
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Pre independence Education in Inndia.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Business Ethics Teaching Materials for college
PDF
Insiders guide to clinical Medicine.pdf
PDF
01-Introduction-to-Information-Management.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Cell Structure & Organelles in detailed.
Abdominal Access Techniques with Prof. Dr. R K Mishra
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Microbial diseases, their pathogenesis and prophylaxis
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Renaissance Architecture: A Journey from Faith to Humanism
O5-L3 Freight Transport Ops (International) V1.pdf
Institutional Correction lecture only . . .
Supply Chain Operations Speaking Notes -ICLT Program
Cell Types and Its function , kingdom of life
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Anesthesia in Laparoscopic Surgery in India
Pre independence Education in Inndia.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Business Ethics Teaching Materials for college
Insiders guide to clinical Medicine.pdf
01-Introduction-to-Information-Management.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Cell Structure & Organelles in detailed.

WCFPresentation.ppt WCFPresentation.ppt WCFPresentation.ppt

  • 2. Agenda • .NET Framework 3.5 Overview • Web Services Overview • Remoting Overview • WCF Overview • Elements of WCF & WCF Architecture • Different Types of WCF Services • Creating your first WCF Service • Service Endpoint Configurations • Service and Data contracts • Consuming your WCF Service from Clients • Tools used in creating Proxies
  • 5. Windows Communication Foundation (WCF) • WCF is Microsoft’s unified programming model that combines the best of .NET distributed systems technologies such as: - ASP.NET Web Services (ASMX) - .NET Remoting (Remoting) - Enterprise Services (COM+) - Web Services Enhancements (WSE) - Microsoft Message Queuing (MSMQ) - Representational State Transfer (REST)
  • 6. What WCF Provides? • Unification of Microsoft’s Distributed Computing Technologies • Interoperability with Applications Built on Other Technologies • Interoperability with Other Web Services Platforms • Interoperability with Microsoft’s Pre-WCF Technologies • Explicit Support for Service-Oriented Development • Framework for building services that process XML messages • Allows to transmit messages using different transport protocols (such as HTTP, TCP, and MSMQ) and using different XML representations (such as text, binary, or MTOM)
  • 8. WCF - Unified Programming Model
  • 11. The Structure of an Endpoint Address: The address uniquely identifies the endpoint and tells potential consumers of the service where it is located. EndPoint usingwsHttpBinding • <add baseAddress="http://localhost:8550/YourNameSpace.You rServiceCV/" /> Endpoint using netNamedPipeBinding • <add baseAddress="net.pipe://localhost/YourNameSpace.YourS erviceCV/" />
  • 12. WCF Bindings Binding Configuration Element Description BasicHttpBinding <basicHttpBinding> A binding that is suitable for communicating with WS-Basic Profile conformant Web services, for example, ASP.NET Web services (ASMX)-based services. This binding uses HTTP as the transport and text/XML as the default message encoding. WSHttpBinding <wsHttpBinding> A secure and interoperable binding that is suitable for non- duplex service contracts. WSDualHttpBinding <wsDualHttpBinding> A secure and interoperable binding that is suitable for duplex service contracts or communication through SOAP intermediaries. WSFederationHttpBinding <wsFederationHttpBinding> A secure and interoperable binding that supports the WS- Federation protocol that enables organizations that are in a federation to efficiently authenticate and authorize users. NetTcpBinding <netTcpBinding> A secure and optimized binding suitable for cross-machine communication between WCF applications. Bindings are used to specify the transport, encoding, and protocol details required for clients and services to communicate with each other. To generate the underlying wire representation of the endpoint, most of the binding details must be agreed upon by the parties that are communicating.
  • 13. WCF Bindings Binding Configuration Element Description NetMsmqBinding <netMsmqBinding> A queued binding that is suitable for cross-machine communication between WCF applications. NetPeerTcpBinding <netPeerTcpBinding> A binding that enables secure, multiple machine communication. MsmqIntegrationBinding <msmqIntegrationBinding> A binding that is suitable for cross-machine communication between a WCF application and existing Message Queuing applications. BasicHttpContextBinding <basicHttpContextBinding> A binding that is suitable for communicating with WS-Basic Profile conformant Web services that enables HTTP cookies to be used to exchange context. NetTcpContextBinding <netTcpContextBinding> A secure and optimized binding suitable for cross-machine communication between WCF applications that enables SOAP headers to be used to exchange context. WebHttpBinding <webHttpBinding> A binding used to configure endpoints for WCF Web services that are exposed through HTTP requests instead of SOAP messages. WSHttpContextBinding <wsHttpContextBinding> A secure and interoperable binding that is suitable for non- duplex service contracts that enables SOAP headers to be used to exchange context. CustomBinding Developer decides Developer decides
  • 14. Steps for Creating WCF Services • Design and Implement WCF Services - [ServiceContract] & [ServiceBehavior] - [OperationContract] & [OperationBehavior] - [DataContract] & [DataMember] - [MessageContract] & [MessageHeader] & [MessageBodyMember] - [FaultContract] • Configure WCF Services - web.config or app.config - Endpoint details: Address, Binding & Contract (SvcConfigEditor.exe)
  • 15. ServiceContract  Use the ServiceContract attribute on an interface (or class) to define a service contract.  ServiceContract combined with an endpoint and address exposes the service to the client  Service class will implement a ServiceContract – Implementing the interface marked with ServiceContract attribute  Example:- [ServiceContract] public interface IMyFirstService { //TODO : Define your Operations here }
  • 16. OperationContract  OperationContract attribute is used in the class (or interface) methods to define the contract's service operations  OperationContract exposes the service operation to the client  All Service Operations (methods) to be exposed to the clients should be marked with OperationContract attribute  Example:- [ServiceContract] public interface IMyFirstService { [OperationContract] string GetData(int value); }
  • 17. DataContract & DataMember  Agreement between the client and the service that describes the data to be exchanged  DataContract Serializer to serialize and de- serialize data  Serialize and De-Serialize is nothing but converting the data to and from xml  In order to tell the serialization engine, we need to use DataContract attribute as a prefix for the class and DataMember attribute prefix for the property(data member)
  • 19. • WCF Architecture: http://msdn2.microsoft.com/en-us/library/aa4802 10.aspx • Basic WCF Programming: http://msdn2.microsoft.com/en-us/library/ms731 067.aspx • WS-* Protocols: http://msdn2.microsoft.com/en- us/library/ms951274.aspx • WCF Bindings : http://msdn.microsoft.com/en- us/magazine/cc163394.aspx References