1 / 15

Intro to WCF From the beginning and uses

Intro to WCF From the beginning and uses. Steve Maier @YsFred4 http://strugglingthru.net/ steve.maier@gmail.com AppRochester. Before WCF. Sockets Named Pipes TCPIP HTTP MSMQ Everything had a different API that you had to learn. Switching from one to another was not simple.

chogan
Download Presentation

Intro to WCF From the beginning and uses

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. Intro to WCF From the beginning and uses Steve Maier @YsFred4 http://strugglingthru.net/ steve.maier@gmail.com AppRochester

  2. Before WCF • Sockets • Named Pipes • TCPIP • HTTP • MSMQ • Everything had a different API that you had to learn. • Switching from one to another was not simple.

  3. With WCF we get… • Consistent interface for all communication • TCP • HTTP • MSMQ • Named Pipes • Peer-to-Peer • XML configuration to define • Endpoints, binding, behaviors, etc • Can use code behind instead of XML

  4. ABCs of WCF • A – Address • the location of the service and the transport protocol used to communicate with the service • B – Binding • How do I talk to the service • Basic binding, TCP binding • C – Contract • a platform-neutral and standard way of describing what the service does

  5. Examples of ABCs of WCF • A – Address • net.tcp://localhost:8081/SpeakerService • http://localhost:49868/SpeakerService.svc • http://localhost:57402/TaPService.svc?wsdl

  6. Examples of ABCs of WCF • B – Binding • netTcpBinding • netPeerTcpBinding • basicHttpBinding (SOAP compatible) • mexHttpBinding • mexHttpsBinding • netNamedPipeBinding • msmqIntegrationBinding

  7. Examples of ABCs of WCF • C – Contract • [ServiceContract]     publicinterfaceISpeakerService{ [OperationContract]         SpeakerInfoGetNextSpeaker();          [OperationContract]         voidAddSpeaker(SpeakerInfonewSpeaker);          [OperationContract]         IEnumerable<SpeakerInfo> GetAllSpeakers();     }

  8. Service Configuration Editor • Windows SDK Tools • Allows editing of the app.config to add services • demo

  9. Service Configuration Editor (cont.)

  10. WCF is just a Web Service?

  11. Hosting WCF Services • WCF Services can be hosted in many different things. • IIS / Azure (ASP.NET project) • Apps • Windows Services

  12. Using WCF for a Singleton • WCF can also be used to implement the Singleton pattern • Yes it is overkill, but it will work • Demo

  13. WCF as a Web Service • Hosted with IIS on a server or in the cloud • ASP.NET projects • Sync (default) or Async • Demo

  14. WCF Goes RESTful • NuGet package from MS for WCF REST services • Demo

  15. WCF Futures • Web API • http://wcf.codeplex.com/ • Way to configure wcf for web messaging, even form posts • Simplified setup • NugetWebApi.All • Jquery Support • JSON

More Related