Thursday, June 27, 2013

Custom WCF Bahavior GOTCHA

WCF also provides a higher-level runtime that sits on top of the channel layer, targeted more at the application developer. It is often referred to throughout the WCF documentation as the service model layer. This higher-level runtime consists primarily of a component called the dispatcher (within the context of a service host) and a component called the proxy (within the context of a client). The dispatcher/proxy combination serves one primary purpose—to translate between WCF Message objects and Microsoft® .NET Framework method calls (see Figure). These components follow a well-defined sequence of steps to perform this process, and at each step along the way they provide extensibility points that you can plug into. You can use these extensibility points to implement a wide variety of custom behaviors including message or parameter validation, message logging, message transformations, custom serialization/deserialization formats, output caching, object pooling, error handling, and authorization, to name a few. Here I'll focus on the implementation of these types of custom behaviors
Figure : WCF Runtime Architecture

When you add a custom behavior to a WCF service to intercept calls before the operation is invoked, you need to add the Fully-Qualified Type Name (FQTN) into the web.config file like the following example.

<behaviorExtensions><add name=”MessageInspector” type=”MessageInspector.MessageInspectorEndpointBehaviour, MessageInspector Version=1.1.0.0, Culture=neutral, PublicKeyToken=2a8e0f2687fa1def″ /></behaviorExtensions>

How to find the Fully Qualified Assembly Name(FQAN) of a GAC registered assembly called 'MessageInspector'?

Command: GACUTIL.EXE /L MessageInspector
Result = MessageInspector, Version=1.1.0.0, Culture=neutral, PublicKeyToken=2a8e0f2687fa1def, processorArchitecture=MSIL


However if you then add the type name to that FQAN, the interceptor fails to execute. Why?
Well see the processor architecture directive at the end? REMOVE IT.
For some reason, Microsoft are doing a string comparison on the FQTN name when determining whether the WCF custom behavior is valid. As a result your WCF services will stop working.

Friday, April 19, 2013

Clean Sticky Footer

We had a requirement in one the of the web applications i am working on to have the footer stick to the bottom no matter what the height of the page content is. When i googled for this task, there are many solutions out there. In fact I experimented several of them to find that the footer hides some of the page contents when the content is larger than the height of the  page content height.

Finally found the solution at cleanstickyfooter which worked like charm.

I just wanted to mark this here first of all for my reference, and then for anybody who came here in search of a solution for a similar problem.


Tuesday, January 10, 2012

What can make me Happy?


This is often time a question that arises in almost every one of us. I would like to discuss this in brief with my own point of view.

Believe it or not the average time that we’ll live on this world is quite small compared to what our heart desires in our young healthy age. You would NOT WASTE the BEST of your time in where you need to be experiencing the joys of the life. I am wondering how one could merely give priority to money other than anything else.


These people bring forth a common equation,

  • Happiness = Money
  • Happiness = Luxury House + Vehicle + Social Parties + Other show Offs
Can I convince myself “Ok, I am HAPPY now”. I personally know people who live in bungalows, run many businesses, and drive the latest of the vehicles, VIPs of social gatherings. As some claim these people could be the Happiest of all. They would cry if you seriously talk to their hearts of the burdens they carry. Often times the family life is shattered. Often times the living is ONLY for the sake of living.


Get to know one thing at least. That is the PURPOSE of the LIFE.

  1. Why did we come to this world?
  2. Why should we give priorities to what we are taught to give?
  3. Are we doing the right thing?
  4. Are we on the right track?
Developing a rational thinking will at least make you understand that you should LIVE your life for a PURPOSE.
I would like to discuss the difference between a Person who is CONTENT with what he Posses and a Person who would always thrive to seek more on MATERIALS and blindly follow the desires of the hearts.

Being content with what you have DOES NOT mean that you should stagnate in one place. You should have PLANs to improve your every aspect. But again this is to do with how one would be HAPPY when he has less expectation but rewarded with something more than what was expected. This is about you being the BOSS of your desires rather than being the SLAVE.

Continued….