Thank you everyone for your all support to my blogs till now, in our last post we covered how and why to use NuGet, NPM and Bower. In this post we will see basics of WCF.
WCF was first introduced in .net framework 3.0 and became very popular with .net developers over the year.It was designed for building distributed systems, but we already had many systems before WCF to achieve the same, to point few of them
- DCOM : used prior to .net came to existence.
- MSMQ: used to deliver the message in distributed system. It was first shipped in C-based API, available in .ne as well.
But web services has its own disadvantages as well, it works perfectly over H TTP, but there might be some requirement where you want to use it within your network over some reliable protocol like TCP. Also when web services were introduced, all big companies like (Microsoft, IBM and Sun Microsystes) started writing there version of it and they were not compatible with each other. To avoid this W3C and WS-I came into existence, which later became the WS*- specifications.
- Support for strongly types and untyped messages. Strongly types means you can create your own classes in .net and another .net can use it, and other languages like java can still use XML.
- Support for several binding like (HTTP, TCP, MSMQ and named pipes), allows us to choose best transport protocol.
- Support for latest WS-* specifications.
- Support for sesision-like state management techniques, as well as support for one way or stateless messages.
Now lets see the core assemblies and Namespaces which are used for WCF.
- Core WCF Assemblies
- System.Runtime.Serialization.dll: This assmbly defines namespaces which we can use for serializing and deserializing objects in WCF.
- System.ServiceModel.dll: This core assembly contains the types used to create a WCF application.
- Core WCF Namespaces
- System.Runtime.Serialization: This defines many types which can be used to control how data is serialzed and deserialized in WCF.
- System.ServiceModel: This namespace defines binding and hosting types, as well as security and transactional types..
- System.ServiceModel.Configuration: This types provide programmatic access to WCF config files.
- System.ServiceModel.Description: This provides an object model to the addresses, bindings and contracts defined within WCF.
- System.ServiceModel.MsmqIntegration: This is used for integration with MSMQ.
- System.ServiceModel.Security: Defines numerous types to control aspects of the WCF security layers.
We know the dlls and classes which is driving our WCF services, let’s see the other aspects of WCF.
ABCs of WCF:
Host and client interact with each other by agreeing upon ABC’s. Let’s see what are those.
- Address: Describes the location of the service.
- Binding: How you are going to exchange data between host and client
- Contract: what type of data is going to be transferred,
We will create a WCF service in our next blog, now we know the purpose of WCF services and core things about WCF. WCF works on SOA (Service Oriented Architecture), so our application will have a service and client to consume the services.
Unlike Web services, WCF gives us much more flexibility over choosing the protocol, more security and many advantages which we will cover in upcoming blogs.
You can follow my official facebook page , also subscribe my blog for more information.
You can also mail me on firstname.lastname@example.org in case you have any questions.