Download presentation
Presentation is loading. Please wait.
Published byTracey Harmon Modified over 9 years ago
1
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#: +923004446625 Email:- Muhammad.zubair82@yahoo.com
2
Introducing Windows Communication Foundation (WCF) Next Generation Connected System on Windows
3
In this Lecture Connected Systems Overview The move towards “Services” Service-Orientation Introduction to WCF WCF Programming model basics Common WCF Questions
4
What is Connected Systems? Development of distributed applications under service- oriented architecture (SOA). Interface An Application that is distributed across multiple computer nodes
5
WCF Internet -HTTP Intranet -TCP How it works?
6
What Is Windows Communication Foundation?.NET Framework provided WCF to build distributed Applications and services. ▫In older days COM, COM+, DCOM, Web Services using XML, SOAP, JSON etc WCF provides a model with which you can implement services that conform to many commonly-accepted styles and standards, including SOAP, XML, and JSON. Additionally, WCF supports many Microsoft-specific technologies for building components, such as Enterprise Services and Microsoft Message Queue (MSMQ), and supports a unified programming model for many of these technologies.
7
Windows Communication Foundation Technologies work within the same network environment, specific to Microsoft family OS such as COM, DCOM, COM+, Enterprise Services, and.NET Framework Remoting Technologies work within the same network environment, specific to Microsoft family OS such as COM, DCOM, COM+, Enterprise Services, and.NET Framework Remoting Technologies work within the same network environment and over WWW such as web services Technologies work within the same network environment and over WWW such as web services
8
Windows Communication Foundation Moving towards Services Market Demand for technology freedom and interoperability is common now Services exposes units of functionality via messaging Interop achived via Standard Protocols and message formats Application Windows “I do.NET!” Service Linux “I do Java!” Service Mainframe “I do Cobol!” Service HTTP XML SOAP RSS
9
Service Design Philosophies Service Oriented Architecture Protocol Representational State Transfer Typically used in Enterprise Applications Typically used in Public Facing Web Scenarios
10
SOAP Transaction
11
SOAP Format Envelope Header Security RM Transactions Body XML Format Envelope Header Security RM Transactions Body XML Format
12
RESTful Services RESTful services typically embrace HTTP, the “Web” transport. ▫HTTP methods GET, PUT, POST, or DELETE etc Services are modeled as “Resources” as with Unique Identifiers (URI’s) ▫www.myWebsite.com/POST /invoice/123www.myWebsite.com/POST /invoice/123 ▫www.myWebsite.com/PUT/invoice/123www.myWebsite.com/PUT/invoice/123 ▫www.myWebsite.com/GET/invoice/123www.myWebsite.com/GET/invoice/123 ▫www.myWebsite.com/DELETE/invoice/123www.myWebsite.com/DELETE/invoice/123 Resources can be presented as XML, RSS, JSON etc
13
SOA (Service Oriented Architecture) SOA is a design paradigm for separation of concerns. ▫Focused on autonomy, explicit boundaries, contracts & policies. ▫Design principles help achieve a Service Oriented Architecture. ▫SOA says nothing about technology – room for both SOAP & REST
14
Windows Communication Foundation Technologies work within the same network environment, specific to Microsoft family OS such as COM, DCOM, COM+, Enterprise Services, and.NET Framework Remoting Technologies work within the same network environment, specific to Microsoft family OS such as COM, DCOM, COM+, Enterprise Services, and.NET Framework Remoting Technologies work within the same network environment and over WWW such as web services Technologies work within the same network environment and over WWW such as web services
15
Introducing WCF WCF namespace ▫System.ServiceModel.dll Just one way to write the code Application Computer 1 WCF Service Computer 3 WCF Service Computer 2 WCF Service MSMQ Binary HTTP RSS TCP SOAP Distributed Object Style SOAP based RESTful Style
16
Just one way to write code Interfaces Services Contracts
17
Many ways to connect with dots Endpoints ▫Configure endpoints to different communication options. Rest over HTTP SOAP + WS-* over MSMQ SOAP + WS-* over TCP
18
Create WCF Service
19
Auto Generated Code ▫Two Service Files Interface Service ▫Interface using namespace “System.ServiceModel” Define “Service Contract” Define “Operation Contract”
20
Create WCF Service ▫Service Implement “Interface” in the Service class Write “Operation Contracts” in Service class
21
Create WCF Service System.ServiceModel.Web ▫The System.ServiceModel.Web namespace contains types that you can use to build WCF services
22
Create WCF Service System.Runtime.Serialization ▫WCF uses the classes in the System.Runtime.Serialization namespace to convert objects into a stream of data suitable for transmitting over the network (a process known as serialization). It also uses them to convert a stream of data received from the network back into objects (deserialization)
23
Create WCF Service Contracts ▫Data Contracts Namespace:- System.Runtime.Serialization Data Member (Expose Members) ▫Service Contracts Namespace:- System.ServiceModel Used in Interface Operation Contract (Expose Operation Members) ▫Operation Contract ▫Method Contract
25
App.Config Configure “EndPoints”
26
Create WCF Service Service Configuration
27
EndPoints ▫All communication with a Windows Communication Foundation (WCF) service occurs through the endpoints of the service ▫Each endpoint consists of four properties: Address An address that indicates where the endpoint can be found. Binding A binding that specifies how a client can communicate with the endpoint. Contract A contract that identifies the operations available. Behavior A set of behaviors that specify local implementation details of the endpoint.
28
Service Configuration Structure of EndPoints ▫Address The address uniquely identifies the endpoint and tells potential consumers of the service where it is located. It is represented in the WCF object model by the EndpointAddress class. An EndpointAddress class contains: URI Property http://msdn.microsoft.com/en-us/library/ms733107.aspx http://msdn.microsoft.com/en-us/library/ms733107.aspx
31
WCF vs Web Api WCF is Microsoft’s unified programming model for building service-oriented applications. It enables developers to build secure, reliable, transacted solutions that integrate across platforms and interoperate with existing investments. ASP.NET Web APIis a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the.NET Framework. This topic presents some guidance to help you decide which technology will best meet your needs.
32
WCF vs Web Api
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.