Click here to Skip to main content
15,886,830 members
Articles / WCF

WCF (Windows Communication Foundation)

Rate me:
Please Sign up or sign in to vote.
4.00/5 (1 vote)
27 Aug 2016CPOL3 min read 4.9K   1  
Windows Communication Foundation

Thank you everyone for all your support so far. In our last post, we covered how and why to use NuGet, NPM and Bower. In this post, we will take a look at the basics of WCF.

Introduction

WCF was first introduced in .NET Framework 3.0 and became very popular with .NET developers over the years. It was designed for building distributed systems, but we already had many systems before WCF to achieve the same, to point few of them:

  1. DCOM: used before .NET came into existence.
  2. MSMQ: used to deliver the message in distributed system. It was first shipped in C-based API, available in .ne as well.
  3. Web Services: Most of the developers are aware of this, and still asked in interviews, before WCF it was the darling for most of the systems, reason being XML format, and can be understood by other languages such as Java, PHP, JavaScript and many more.

But web services has its own disadvantages as well, it works perfectly over HTTP, 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 their 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.

WCF Features

  1. Support for strongly typed and untyped messages. Strongly typed means you can create your own classes in .NET and another .NET can use it, and other languages like Java can still use XML.
  2. Support for several binding like (HTTP, TCP, MSMQ and named pipes) allows us to choose best transport protocol.
  3. Support for latest WS-* specifications.
  4. Support for session-like state management techniques, as well as support for one way or stateless messages.

Now let's see the core assemblies and namespaces which are used for WCF.

  1. Core WCF Assemblies
    1. System.Runtime.Serialization.dll: This assembly defines namespaces which we can use for serializing and deserializing objects in WCF.
    2. System.ServiceModel.dll: This core assembly contains the types used to create a WCF application.
  2. Core WCF Namespaces
    1. System.Runtime.Serialization: This defines many types which can be used to control how data is serialzed and deserialized in WCF.
    2. System.ServiceModel: This namespace defines binding and hosting types, as well as security and transactional types..
    3. System.ServiceModel.Configuration: This type provide programmatic access to WCF config files.
    4. System.ServiceModel.Description: This provides an object model to the addresses, bindings and contracts defined within WCF.
    5. System.ServiceModel.MsmqIntegration: This is used for integration with MSMQ.
    6. System.ServiceModel.Security: Defines numerous types to control aspects of the WCF security layers.

We know the DLLs and classes which are 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 ABCs. Let’s see what those are.

  1. Address: Describes the location of the service
  2. Binding: How you are going to exchange data between host and client
  3. 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.

Conclusion

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, and you can also subscribe to my blog for more information.

You can also mail me on santosh.yadav19613@gmail.com in case you have any questions.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader Synechron Technologies
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --