Maverick

Thursday, February 28, 2008

MS Big Launch

Filed under: .NET Framework, Windows 2008 Server, windows 2003 Server — debasishpramanik @ 11:30 am

Tuesday, February 26, 2008

Life Cycle of Custom Controls

Filed under: .NET Framework, ASP.NET, C# — debasishpramanik @ 11:41 am

Thought of sharing the life cycle of custom control in ASP.NET. I hope it helps if someone has to add something please do leave a comment

controllifecycle.gif

Tuesday, February 12, 2008

Good Links on WCF

Filed under: .NET Framework, WCF, Web Services — debasishpramanik @ 9:59 am

Friday, February 1, 2008

WCF: Hosting Service with multiple end points

Filed under: .NET Framework, C#, SOA, WCF — debasishpramanik @ 8:12 pm
Tags: , , ,

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.

Blog at WordPress.com.