WCF: Hosting Service with multiple end points

In continuation of previous post regarding WCF, here goes another. In this post I will do step step explanation for hosting service using config file (remember this is the beauty of WCF, we don’t need to recompile to add multiple endpoints).

The assumtion is readers have already implemented the service contract. I will use a dummy class named IService for my explanation

  1. Create a instance of ServiceHost. 
    1. ServiceHost servicehost = new ServiceHost(typeof(Examples.ServiceImplementation));
  2. Use the Open to start listening.
    1. servicehost.Open();
  3. Now put the following in the App.Config file

config1.gif

Let me explain each of the element

  • The host element declares the base address for the endpoint. In this case its declaring two base address the http address and another one is the tcp address. The host address is used by the ServiceHost to listen on the respective port and address.

host.gif

  • There are three endpoints

http.gif

Each endpoint basically is collection of address, contract and binding. Here in the above case the address is not specified as we have already sepcified in the base address. The contract is Examples.IService and the binding is HTTP.

  • The second endpoint

tcp.gif

is the TCP endpoint for the same service. Smilar to the previous one this definess the endpoint as collection of Examples.IService as contract and binding as TCP and address is not mentioned and taken from the base address.

  • The last endpoint

mex.gif

is used by the client to generate the meta information about the Service. This  is standard and ideally should be there for each service.I hope the above helps in understanding this beautiful technology.

The author has 10+ years experience with Enterprise Poduct Development. He is also the Co-Founder of PCVITA. He have expertise in Enterprise Architecture, Enterprise Messaging Platform Migration, Email Archiving.

Advertisements

QuickRules.NET 3.1 Beta 2 Released

YASU  Technologies one of the leading BRMS vendor announced the release of their .NET BRMS version QuikcRules.NET 3.1 beta 2.

        Flow Editor

The QuickRules.NET 3.1 Beta 2 comes with some exciting features that make it unique compare to other vendors in the same field

  1. For old customers, it claims to improve its productivity of Rule Development upto 268% which is amazing.
  2. The WebEditor which is used by end user as part of Change Management/Hot Deployment of Rules now supports localization which means business analyst can now manage rules in local language :).
  3. The Rule Builder provides a single editor interface (i.e. no dialog box) to write rules for Rule Developer.
  4. The Rule Builder also has its own Autocomplete and Intellisense feature, which makes rule writting a excitting stuff.
  5. For platform supports it now supports the latest OS Windows Vista and Office 2007 (Visio and Excel).
  6. The Rule Repository have been improved to seamlessly integrate with enterprise authentication mechanism. 

For beginners, use this video to understand BRMS and How QuickRules.NET solves the problem. 

Please go ahead and download the Beta 2 version from the YASU website.

KISS SOA

I have been quite busy with too many things at my professional front,so unable to write some good stuff. Though I happen to read this article on SOA, so thought of sharing the link with everyone. The reason I say KISS SOA, as the author believed in Keep It Simple and Straight

http://blog.objectmentor.com/articles/2007/04/11/what-is-soa-really

Please read this, this will reallly demystify a bit about the ocean called SOA.