Download presentation
Presentation is loading. Please wait.
Published byVictor Richards Modified over 9 years ago
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] public interface ISpeakerService { [OperationContract] SpeakerInfo GetNextSpeaker(); [OperationContract] void AddSpeaker(SpeakerInfo newSpeaker); [OperationContract] IEnumerable 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? Web ServicesWCF Asmxsvc but can be treated like an asmx HTTP and statelessDifferent hosting environments (IIS, apps, services) SOAP (http and xml)Binary or text data XmlSerializerDataContractSerializer Exceptions are SOAP faultsExceptions can be configured to be handed back to the client
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 Nuget WebApi.All Jquery Support JSON
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.