1 / 36

Microsoft Visual Studio 2010

Microsoft Visual Studio 2010. Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#: +923004446625 Email:- Muhammad.zubair82@yahoo.com. Introducing Windows Communication Foundation (WCF). Next Generation Connected System on Windows. In this Lecture.

Download Presentation

Microsoft Visual Studio 2010

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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? An Application that is distributed across multiple computer nodes Development of distributed applications under service-oriented architecture (SOA). Interface Interface

  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 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 • Interopachived via Standard Protocols and message formats HTTP Windows “I do .NET!” Service HTTP XML RSS Linux “I do Java!” Service Mainframe “I do Cobol!” Service HTTP SOAP Application

  9. Service Design Philosophies Typically used in Enterprise Applications Service Oriented Architecture Protocol Typically used in Public Facing Web Scenarios Representational State Transfer

  10. SOAP Transaction

  11. SOAP 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/123 • www.myWebsite.com/PUT/invoice/123 • www.myWebsite.com/GET/invoice/123 • www.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 and over WWW such as web services

  15. The Ideal Communication framework

  16. Introducing WCF • WCF namespace • System.ServiceModel.dll • Just one way to write the code MSMQ SOAP based Computer 1 WCF Service WCF Service HTTP SOAP RESTful Style RSS TCP Computer 3 WCF Service Computer 2 WCF Service Binary Distributed Object Style Application

  17. Just one way to write code • Interfaces • Services Contracts

  18. Many ways to connect with dots • Endpoints • Configure endpoints to different communication options. Rest over HTTP SOAP + WS-* over MSMQ SOAP + WS-* over TCP

  19. Create WCF Service

  20. Create WCF Service • Auto Generated Code • Two Service Files • Interface • Service • Interface • using namespace “System.ServiceModel” • Define “Service Contract” • Define “Operation Contract”

  21. Create WCF Service • Service • Implement “Interface” in the Service class • Write “Operation Contracts” in Service class

  22. Create WCF Service • System.ServiceModel.Web • The System.ServiceModel.Web namespace contains types that you can use to build WCF services

  23. 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)

  24. 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. Service Configuration • 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

  29. Bindings

  30. Server Side Services

  31. WCF Soap Services

  32. WCF Soap Service Design Style • Fire and Forget • One way messaging • No response. • No Error response • Remote Procedure Calls • Request / Response • Out of process interactions

  33. 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.

  34. WCF vs Web Api

More Related