<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>anandj123's Blog</title>
	<atom:link href="http://anandj123.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://anandj123.wordpress.com</link>
	<description>My thoughts on how software should be done</description>
	<lastBuildDate>Wed, 22 Jul 2009 04:46:47 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='anandj123.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/9c80374a43b08cf0a038ca8ab45bb42f?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>anandj123's Blog</title>
		<link>http://anandj123.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://anandj123.wordpress.com/osd.xml" title="anandj123&#8217;s Blog" />
		<item>
		<title>A beutiful song</title>
		<link>http://anandj123.wordpress.com/2009/07/22/a-beutiful-song/</link>
		<comments>http://anandj123.wordpress.com/2009/07/22/a-beutiful-song/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 04:46:47 +0000</pubDate>
		<dc:creator>anandj123</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://anandj123.wordpress.com/?p=270</guid>
		<description><![CDATA[Here is another beautiful song, enjoy!

Posted in Uncategorized       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=270&subd=anandj123&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here is another beautiful song, enjoy!</p>
<p><span style="text-align:center; display: block;"><a href="http://anandj123.wordpress.com/2009/07/22/a-beutiful-song/"><img src="http://img.youtube.com/vi/u5infho-6nQ/2.jpg" alt="" /></a></span></p>
Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anandj123.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anandj123.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anandj123.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anandj123.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anandj123.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anandj123.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anandj123.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anandj123.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anandj123.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anandj123.wordpress.com/270/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=270&subd=anandj123&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anandj123.wordpress.com/2009/07/22/a-beutiful-song/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/315119c6bbc10130f64e371b744d30db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anandj123</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/u5infho-6nQ/2.jpg" medium="image" />
	</item>
		<item>
		<title>A few more songs that are close to me</title>
		<link>http://anandj123.wordpress.com/2009/07/05/a-few-more-songs-that-are-close-to-me/</link>
		<comments>http://anandj123.wordpress.com/2009/07/05/a-few-more-songs-that-are-close-to-me/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 01:20:27 +0000</pubDate>
		<dc:creator>anandj123</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://anandj123.wordpress.com/?p=265</guid>
		<description><![CDATA[A few that always brings out tears in my eyes.


Such a beautiful advertisement. Is it not fitting that instead of expecting others to fix our problems we should try ourselves? Most times children are best teachers because they are still so not touched by all the human politics. 

Now my lord. He is the one [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=265&subd=anandj123&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A few that always brings out tears in my eyes.</p>
<p><span style="text-align:center; display: block;"><a href="http://anandj123.wordpress.com/2009/07/05/a-few-more-songs-that-are-close-to-me/"><img src="http://img.youtube.com/vi/kgjCfHn3x2g/2.jpg" alt="" /></a></span></p>
<p><span style="text-align:center; display: block;"><a href="http://anandj123.wordpress.com/2009/07/05/a-few-more-songs-that-are-close-to-me/"><img src="http://img.youtube.com/vi/_ueUsrIrCMM/2.jpg" alt="" /></a></span></p>
<p>Such a beautiful advertisement. Is it not fitting that instead of expecting others to fix our problems we should try ourselves? Most times children are best teachers because they are still so not touched by all the human politics. </p>
<p><span style="text-align:center; display: block;"><a href="http://anandj123.wordpress.com/2009/07/05/a-few-more-songs-that-are-close-to-me/"><img src="http://img.youtube.com/vi/ErbH7dT8prk/2.jpg" alt="" /></a></span></p>
<p>Now my lord. He is the one who links the end to the beginning. So it&#8217;s only fitting that he is here.</p>
<p><span style="text-align:center; display: block;"><a href="http://anandj123.wordpress.com/2009/07/05/a-few-more-songs-that-are-close-to-me/"><img src="http://img.youtube.com/vi/7aMLiGO2eqA/2.jpg" alt="" /></a></span></p>
Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anandj123.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anandj123.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anandj123.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anandj123.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anandj123.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anandj123.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anandj123.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anandj123.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anandj123.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anandj123.wordpress.com/265/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=265&subd=anandj123&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anandj123.wordpress.com/2009/07/05/a-few-more-songs-that-are-close-to-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/315119c6bbc10130f64e371b744d30db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anandj123</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/kgjCfHn3x2g/2.jpg" medium="image" />

		<media:content url="http://img.youtube.com/vi/_ueUsrIrCMM/2.jpg" medium="image" />

		<media:content url="http://img.youtube.com/vi/ErbH7dT8prk/2.jpg" medium="image" />

		<media:content url="http://img.youtube.com/vi/7aMLiGO2eqA/2.jpg" medium="image" />
	</item>
		<item>
		<title>Nostalgic songs collection</title>
		<link>http://anandj123.wordpress.com/2009/07/05/nostalgic-songs-collection/</link>
		<comments>http://anandj123.wordpress.com/2009/07/05/nostalgic-songs-collection/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 00:54:47 +0000</pubDate>
		<dc:creator>anandj123</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://anandj123.wordpress.com/?p=258</guid>
		<description><![CDATA[Here are a few songs which are very personal and always always brings out the nostalgic feelings in me. They were with me in my growing years and have left a deep mark.
Well this is very fitting, How do you figure out what life is all out?

A few more gems!




What can i say about Mukesh? [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=258&subd=anandj123&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here are a few songs which are very personal and always always brings out the nostalgic feelings in me. They were with me in my growing years and have left a deep mark.</p>
<p>Well this is very fitting, How do you figure out what life is all out?</p>
<p><span style="text-align:center; display: block;"><a href="http://anandj123.wordpress.com/2009/07/05/nostalgic-songs-collection/"><img src="http://img.youtube.com/vi/E_WV6HRq3SM/2.jpg" alt="" /></a></span></p>
<p>A few more gems!</p>
<p><span style="text-align:center; display: block;"><a href="http://anandj123.wordpress.com/2009/07/05/nostalgic-songs-collection/"><img src="http://img.youtube.com/vi/vJ9fIIf4dBg/2.jpg" alt="" /></a></span></p>
<p><span style="text-align:center; display: block;"><a href="http://anandj123.wordpress.com/2009/07/05/nostalgic-songs-collection/"><img src="http://img.youtube.com/vi/sBfmLz1U7ng/2.jpg" alt="" /></a></span></p>
<p><span style="text-align:center; display: block;"><a href="http://anandj123.wordpress.com/2009/07/05/nostalgic-songs-collection/"><img src="http://img.youtube.com/vi/m1hFp9wI8SY/2.jpg" alt="" /></a></span></p>
<p><span style="text-align:center; display: block;"><a href="http://anandj123.wordpress.com/2009/07/05/nostalgic-songs-collection/"><img src="http://img.youtube.com/vi/kpM0jPd6-7w/2.jpg" alt="" /></a></span></p>
<p>What can i say about Mukesh? </p>
<p><span style="text-align:center; display: block;"><a href="http://anandj123.wordpress.com/2009/07/05/nostalgic-songs-collection/"><img src="http://img.youtube.com/vi/6B_BOpS-W_I/2.jpg" alt="" /></a></span></p>
<p>Nothing can match the classics</p>
<p><span style="text-align:center; display: block;"><a href="http://anandj123.wordpress.com/2009/07/05/nostalgic-songs-collection/"><img src="http://img.youtube.com/vi/xtDrk7aayEg/2.jpg" alt="" /></a></span></p>
<p>A few song that brings out the my post graduations (1993-1995) day in me.</p>
<p><span style="text-align:center; display: block;"><a href="http://anandj123.wordpress.com/2009/07/05/nostalgic-songs-collection/"><img src="http://img.youtube.com/vi/9mjFCidDpcY/2.jpg" alt="" /></a></span></p>
<p>Here is a tragic, I had a very close friend. In college years, he was infatuated with a girl in front his house. So we used to tease him with the following song. Sadly, he died in a motorcycle accident at a tender age of 22. Very sad, such a nice and cultured boy. A real loss. How can you explain such things?</p>
<p><span style="text-align:center; display: block;"><a href="http://anandj123.wordpress.com/2009/07/05/nostalgic-songs-collection/"><img src="http://img.youtube.com/vi/S0WPSYFm7iE/2.jpg" alt="" /></a></span></p>
Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anandj123.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anandj123.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anandj123.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anandj123.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anandj123.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anandj123.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anandj123.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anandj123.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anandj123.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anandj123.wordpress.com/258/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=258&subd=anandj123&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anandj123.wordpress.com/2009/07/05/nostalgic-songs-collection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/315119c6bbc10130f64e371b744d30db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anandj123</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/E_WV6HRq3SM/2.jpg" medium="image" />

		<media:content url="http://img.youtube.com/vi/vJ9fIIf4dBg/2.jpg" medium="image" />

		<media:content url="http://img.youtube.com/vi/sBfmLz1U7ng/2.jpg" medium="image" />

		<media:content url="http://img.youtube.com/vi/m1hFp9wI8SY/2.jpg" medium="image" />

		<media:content url="http://img.youtube.com/vi/kpM0jPd6-7w/2.jpg" medium="image" />

		<media:content url="http://img.youtube.com/vi/6B_BOpS-W_I/2.jpg" medium="image" />

		<media:content url="http://img.youtube.com/vi/xtDrk7aayEg/2.jpg" medium="image" />

		<media:content url="http://img.youtube.com/vi/9mjFCidDpcY/2.jpg" medium="image" />

		<media:content url="http://img.youtube.com/vi/S0WPSYFm7iE/2.jpg" medium="image" />
	</item>
		<item>
		<title>Eugene Fama’s Books</title>
		<link>http://anandj123.wordpress.com/2009/06/02/eugene-fama%e2%80%99s-books/</link>
		<comments>http://anandj123.wordpress.com/2009/06/02/eugene-fama%e2%80%99s-books/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 15:46:56 +0000</pubDate>
		<dc:creator>anandj123</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://anandj123.wordpress.com/2009/06/02/eugene-fama%e2%80%99s-books/</guid>
		<description><![CDATA[Eugene Fama is one of the pioneer&#8217;s of efficient market hypothesis. He is the guy behind Fama-French model and countless other theories behind Modern Portfolio Theory. There is none other more respected individual in finance then him. He has written 2 books which are long out of print. He has made copies of those books [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=253&subd=anandj123&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Eugene Fama is one of the pioneer&#8217;s of efficient market hypothesis. He is the guy behind Fama-French model and countless other theories behind Modern Portfolio Theory. There is none other more respected individual in finance then him. He has written 2 books which are long out of print. He has made copies of those books and made available.
</p>
<p>Take a look:
</p>
<p><a href="http://faculty.chicagobooth.edu/eugene.fama/research/index.htm">http://faculty.chicagobooth.edu/eugene.fama/research/index.htm</a>
	</p>
<p>If you are really interested in the math behind Modern Finance (or if you are feeling less challenged in your current environment), you can give these books a try. They are real gem (Caution, they are used for Phd. Courses in University of Chicago Finance department).</p>
Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anandj123.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anandj123.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anandj123.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anandj123.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anandj123.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anandj123.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anandj123.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anandj123.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anandj123.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anandj123.wordpress.com/253/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=253&subd=anandj123&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anandj123.wordpress.com/2009/06/02/eugene-fama%e2%80%99s-books/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/315119c6bbc10130f64e371b744d30db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anandj123</media:title>
		</media:content>
	</item>
		<item>
		<title>Securing a windows folder</title>
		<link>http://anandj123.wordpress.com/2009/05/04/securing-a-windows-folder/</link>
		<comments>http://anandj123.wordpress.com/2009/05/04/securing-a-windows-folder/#comments</comments>
		<pubDate>Mon, 04 May 2009 15:18:07 +0000</pubDate>
		<dc:creator>anandj123</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://anandj123.wordpress.com/2009/05/04/securing-a-windows-folder/</guid>
		<description><![CDATA[I was trying to enable the Encrypted file system (windows EFS) in my box.

Here is a great post describing in detail how to do it:

http://articles.techrepublic.com.com/5100-10878_11-5308684.html
	
And I faced a lot of problem. I tried to setup the EFS using group policy editor which shows that it is enables. But I used to get the following error [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=252&subd=anandj123&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I was trying to enable the Encrypted file system (windows EFS) in my box.
</p>
<p>Here is a great post describing in detail how to do it:
</p>
<p><a href="http://articles.techrepublic.com.com/5100-10878_11-5308684.html">http://articles.techrepublic.com.com/5100-10878_11-5308684.html</a>
	</p>
<p>And I faced a lot of problem. I tried to setup the EFS using group policy editor which shows that it is enables. But I used to get the following error message all the time (&#8220;This machine is disabled for file encryption&#8221;)
</p>
<p><img src="http://anandj123.files.wordpress.com/2009/05/050409-1517-securingawi1.png">
	</p>
<p>I did not know what the problem was, till I got this post.
</p>
<p><a href="http://www.mydigitallife.info/2007/05/23/workaround-to-install-windows-powershell-on-efs-disabled-vista/">http://www.mydigitallife.info/2007/05/23/workaround-to-install-windows-powershell-on-efs-disabled-vista/</a>
	</p>
<p>What basically was happening was that my machine was joined to a primary domain controller and my individual machine settings were not taking effect because the domain controller used to replace it every time.
</p>
<p>No way to know this unless you use the effective resultant policy using the command <strong>rsop.msc</strong>
	</p>
<p>To view the group policy editor use the command: <strong>gpedit.msc</strong>
	</p>
<p>To view the effective resultant policy use the command: <strong>rsop.msca<br />
</strong></p>
<p>
 </p>
Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anandj123.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anandj123.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anandj123.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anandj123.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anandj123.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anandj123.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anandj123.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anandj123.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anandj123.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anandj123.wordpress.com/252/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=252&subd=anandj123&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anandj123.wordpress.com/2009/05/04/securing-a-windows-folder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/315119c6bbc10130f64e371b744d30db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anandj123</media:title>
		</media:content>

		<media:content url="http://anandj123.files.wordpress.com/2009/05/050409-1517-securingawi1.png" medium="image" />
	</item>
		<item>
		<title>How to do WCF UserName token authentication with dynamic proxy for test driven development (TDD)</title>
		<link>http://anandj123.wordpress.com/2009/04/24/how-to-do-wcf-username-token-authentication-with-dynamic-proxy-for-test-driven-development-tdd/</link>
		<comments>http://anandj123.wordpress.com/2009/04/24/how-to-do-wcf-username-token-authentication-with-dynamic-proxy-for-test-driven-development-tdd/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 14:52:12 +0000</pubDate>
		<dc:creator>anandj123</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://anandj123.wordpress.com/2009/04/24/how-to-do-wcf-username-token-authentication-with-dynamic-proxy-for-test-driven-development-tdd/</guid>
		<description><![CDATA[Problem definition:

Previously I have linked to a website which describes in detail how to enable your WCF applications for username tokens authentication. That article went thru the setup of username token authentication using configuration files and client proxies. That is alright if you want to generate client proxies and use in your client application.
For testability [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=247&subd=anandj123&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="font-size:16pt;text-decoration:underline;"><strong>Problem definition:<br />
</strong></span></p>
<p>Previously I have <a href="http://anandj123.wordpress.com/2009/03/03/wcf-using-username-authentication/">linked</a> to a website which describes in detail how to enable your WCF applications for username tokens authentication. That article went thru the setup of username token authentication using configuration files and client proxies. That is alright if you want to generate client proxies and use in your client application.</p>
<p>For testability reasons (which I will describe) we need to be able to use dynamic proxies for WCF services. I had to search a few places to gather all the required information to do this. Here I will describe how it can be done from a test driven development (TDD) methodology standpoint.</p>
<p><span style="font-size:18pt;text-decoration:underline;"><strong>Approach/Solution:<br />
</strong></span></p>
<p>In the example I have used a classical <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC</a> pattern with service implementation for retrieving the model. At a high level the complete data flow is represented as:</p>
<p> </p>
<p><img src="http://anandj123.files.wordpress.com/2009/04/042409-1452-howtodowcfu1.png" alt="" /></p>
<p>I am just going to explain about the Web-server layer where the MVC pattern and WCF dynamic proxy resides. Maybe later I can go explain the other tiers and some of their nice features.</p>
<p>I created a View like the following:</p>
<div>
<table style="border-collapse:collapse;" border="0">
<col span="1"></col>
<tbody>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:solid #f9b074 1pt;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">public </span><span style="color:blue;">interface </span><span style="color:#2b91af;">ISearchUserView</span></strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>{</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">string</span> SystemTextBox {<span style="color:blue;">get</span>; <span style="color:blue;">set</span>;}</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">string</span> HostTextBox { <span style="color:blue;">get</span>; <span style="color:blue;">set</span>; }</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">string</span> BankTextBox { <span style="color:blue;">get</span>; <span style="color:blue;">set</span>; }</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">string</span> PathTextBox { <span style="color:blue;">get</span>; <span style="color:blue;">set</span>; }</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:#2b91af;">ArrayList</span> DataFormatDropDownList { <span style="color:blue;">get</span>; <span style="color:blue;">set</span>; }</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:#2b91af;">ArrayList</span> TradingMethodDropDownList { <span style="color:blue;">get</span>; <span style="color:blue;">set</span>; }</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:#2b91af;">GenericCollection</span>&lt;<span style="color:#2b91af;">UserData</span>&gt; UserGridView { <span style="color:blue;">set</span>; }</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>}</strong></span></td>
</tr>
</tbody>
</table>
</div>
<p> The implementation of the view is not important for this article, so I will leave that as well for now.</p>
<p>Then I created a controller which holds the view.</p>
<div>
<table style="border-collapse:collapse;" border="0">
<col span="1"></col>
<tbody>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:solid #f9b074 1pt;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">public </span><span style="color:blue;">class </span><span style="color:#2b91af;">SearchUserController</span></strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>{</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"> </td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">private </span><span style="color:#2b91af;">IDataService</span> _service = <span style="color:blue;">null</span>;</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">private</span> Views.<span style="color:#2b91af;">ISearchUserView</span> _view = <span style="color:blue;">null</span>;</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">public</span> Views.<span style="color:#2b91af;">ISearchUserView</span> View</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>{</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">get</span> { <span style="color:blue;">return</span> _view; }</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">set</span> { _view = <span style="color:blue;">value</span>; }</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>}</strong></span></td>
</tr>
</tbody>
</table>
</div>
<p> </p>
<p>Now the relevant parts are the following code:</p>
<div>
<table style="border-collapse:collapse;" border="0">
<col span="1"></col>
<tbody>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:solid #f9b074 1pt;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><br />
<span style="color:blue;">public</span> SearchUserController(Views.<span style="color:#2b91af;">ISearchUserView</span> view)</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>{</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>View = view;</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"> </td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><br />
<span style="color:#2b91af;">WSHttpBinding</span> binding = <span style="color:blue;">new </span><span style="color:#2b91af;">WSHttpBinding</span>(<span style="color:#a31515;">&#8220;WSHttpBinding_IDataService&#8221;</span>);</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:#2b91af;">EndpointAddress</span> address = </strong></span><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">new </span><span style="color:#2b91af;">EndpointAddress </span></strong></span><span style="font-family:Courier New;font-size:10pt;"><strong>(<span style="color:blue;">new </span><span style="color:#2b91af;">Uri</span>(<span style="color:#a31515;">&#8220;http://localhost:8731/Web.Service/DataService/&#8221;</span>),</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">new </span><span style="color:#2b91af;">DnsEndpointIdentity</span>(<span style="color:#a31515;">&#8220;MyServerCert&#8221;</span>));</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><br />
<span style="color:#2b91af;">ChannelFactory</span>&lt;<span style="color:#2b91af;">IDataService</span>&gt; service =  </strong></span><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">new </span><span style="color:#2b91af;">ChannelFactory</span>&lt;<span style="color:#2b91af;">IDataService</span>&gt;(binding, address);</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"> </td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:green;">// Add the user name token to the request, these should come from the config file</span></strong></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><strong></strong></span><span style="color:green;font-family:Courier New;font-size:10pt;"><strong>// where we should encrypt them</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>service.Credentials.UserName.UserName = <span style="color:#a31515;">&#8220;test&#8221;</span>;</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>service.Credentials.UserName.Password = <span style="color:#a31515;">&#8220;test&#8221;</span>;</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"> </td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:green;">// Custom SSL validation of the server certificate,<br />
</span></strong></span></p>
<p><span style="color:green;font-family:Courier New;font-size:10pt;"><strong>// this we don&#8217;t need in production.</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:green;">// in dev the cert is really not valid so to bypass the certificate validation<br />
</span></strong></span></p>
<p><span style="color:green;font-family:Courier New;font-size:10pt;"><strong>// we need custom validation here.</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>service.Credentials.ServiceCertificate.Authentication.CertificateValidationMode = </strong></span><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:#2b91af;">X509CertificateValidationMode</span>.Custom;</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>service.Credentials.ServiceCertificate.Authentication.CustomCertificateValidator = </strong></span><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">new </span><span style="color:#2b91af;">MyX509Validator</span>();</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"> </td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>_service = service.CreateChannel();</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>}</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"> </td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:green;">// Dependency injection</span></strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">public</span> SearchUserController(<span style="color:#2b91af;">IDataService</span> service, Views.<span style="color:#2b91af;">ISearchUserView</span> view)</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>{</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>_service = service;</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>_view = view;</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>}</strong></span></td>
</tr>
</tbody>
</table>
</div>
<p> Let me go thru each line of the code.</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">public</span> SearchUserController(Views.<span style="color:#2b91af;">ISearchUserView</span> view)<br />
</span></p>
<p>This is a constructor that I am overriding which accepts a view, nothing special.</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:#2b91af;">WSHttpBinding</span> binding = <span style="color:blue;">new</span><br />
<span style="color:#2b91af;">WSHttpBinding</span>(<span style="color:#a31515;">&#8220;WSHttpBinding_IDataService&#8221;</span>);<br />
</span></p>
<p>Now we need to define the binding properties in the client side to connect to the server. The server is an implementation of the following ServiceContract.</p>
<div>
<table style="border-collapse:collapse;" border="0">
<col span="1"></col>
<tbody>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:solid #f9b074 1pt;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>[<span style="color:#2b91af;">ServiceContract</span>]</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">public </span><span style="color:blue;">interface </span><span style="color:#2b91af;">IDataService</span></strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>{</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>[<span style="color:#2b91af;">OperationContract</span>]</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:#2b91af;">GenericCollection</span>&lt;<span style="color:#2b91af;">UserData</span>&gt; GetUsers(<span style="color:blue;">string</span> bankName);</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>}</strong></span></td>
</tr>
</tbody>
</table>
</div>
<p> The binding is defined in the web.config file of the web-project as:</p>
<div>
<table style="border-collapse:collapse;" border="0">
<col span="1"></col>
<tbody>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:solid #f9b074 1pt;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">&lt;!&#8211;</span><span style="color:green;"> WCF binding configurations </span><span style="color:blue;">&#8211;&gt;</span></strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">    &lt;</span><span style="color:#a31515;">system.serviceModel</span><span style="color:blue;">&gt;</span></strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">        &lt;</span><span style="color:#a31515;">bindings</span><span style="color:blue;">&gt;</span></strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">            &lt;</span><span style="color:#a31515;">wsHttpBinding</span><span style="color:blue;">&gt;</span></strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">                &lt;</span><span style="color:#a31515;">binding </span><span style="color:red;">name</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">WSHttpBinding_IDataService</span>&#8221; <span style="color:red;">closeTimeout</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">00:01:00</span>&#8220;</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:red;">openTimeout</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">00:01:00</span>&#8221; <span style="color:red;">receiveTimeout</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">00:10:00</span>&#8221; <span style="color:red;">sendTimeout</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">00:01:00</span>&#8221; </strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:red;">bypassProxyOnLocal</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">false</span>&#8221; <span style="color:red;">transactionFlow</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">false</span>&#8221; <span style="color:red;">hostNameComparisonMode</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">StrongWildcard</span>&#8220;</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:red;">maxBufferPoolSize</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">524288</span>&#8221; <span style="color:red;">maxReceivedMessageSize</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">65536</span>&#8220;</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:red;">messageEncoding</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Text</span>&#8221; <span style="color:red;">textEncoding</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">utf-8</span>&#8221; <span style="color:red;">useDefaultWebProxy</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">true</span>&#8220;</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:red;">allowCookies</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">false</span>&#8220;<span style="color:blue;">&gt;</span></strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">                    &lt;</span><span style="color:#a31515;">readerQuotas </span><span style="color:red;">maxDepth</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">32</span>&#8221; <span style="color:red;">maxStringContentLength</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">8192</span>&#8221; <span style="color:red;">maxArrayLength</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">16384</span>&#8220;</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:red;">maxBytesPerRead</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">4096</span>&#8221; <span style="color:red;">maxNameTableCharCount</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">16384</span>&#8220;<span style="color:blue;"> /&gt;</span></strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">                    &lt;</span><span style="color:#a31515;">reliableSession </span><span style="color:red;">ordered</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">true</span>&#8221; <span style="color:red;">inactivityTimeout</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">00:10:00</span>&#8220;</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:red;">enabled</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">false</span>&#8220;<span style="color:blue;"> /&gt;</span></strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">                    &lt;</span><span style="color:#a31515;">security </span><span style="color:red;">mode</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Message</span>&#8220;<span style="color:blue;">&gt;</span></strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">                        &lt;</span><span style="color:#a31515;">transport </span><span style="color:red;">clientCredentialType</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Basic</span>&#8221; <span style="color:red;">proxyCredentialType</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">None</span>&#8221; <span style="color:red;">realm</span><span style="color:blue;">=</span>&#8220;&#8221;<span style="color:blue;"> /&gt;</span></strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">                        &lt;</span><span style="color:#a31515;">message </span><span style="color:red;">clientCredentialType</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">UserName</span>&#8221; <span style="color:red;">negotiateServiceCredential</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">true</span>&#8221; <span style="color:red;">algorithmSuite</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Default</span>&#8221; <span style="color:red;">establishSecurityContext</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">true</span>&#8220;<span style="color:blue;"> /&gt;</span></strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">                    &lt;/</span><span style="color:#a31515;">security</span><span style="color:blue;">&gt;</span></strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">                &lt;/</span><span style="color:#a31515;">binding</span><span style="color:blue;">&gt;</span></strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">            &lt;/</span><span style="color:#a31515;">wsHttpBinding</span><span style="color:blue;">&gt;</span></strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">        &lt;/</span><span style="color:#a31515;">bindings</span><span style="color:blue;">&gt;</span></strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">    &lt;/</span><span style="color:#a31515;">system.serviceModel</span><span style="color:blue;">&gt;</span></strong></span></td>
</tr>
</tbody>
</table>
</div>
<p> Most of the configuration entries are not important at this point. Only thing that is worth pointing out is the security settings.</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">                    &lt;</span><span style="color:#a31515;">security </span><span style="color:red;">mode</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Message</span>&#8220;<span style="color:blue;">&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">                        &lt;</span><span style="color:#a31515;">transport </span><span style="color:red;">clientCredentialType</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Basic</span>&#8221; <span style="color:red;">proxyCredentialType</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">None</span>&#8221; <span style="color:red;">realm</span><span style="color:blue;">=</span>&#8220;&#8221;<span style="color:blue;"> /&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">                        &lt;</span><span style="color:#a31515;">message </span><span style="color:red;">clientCredentialType</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">UserName</span>&#8220;  <span style="color:red;">negotiateServiceCredential</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">true</span>&#8221; <span style="color:red;">algorithmSuite</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Default</span>&#8221; <span style="color:red;">establishSecurityContext</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">true</span>&#8220;<span style="color:blue;"> /&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">                    &lt;/</span><span style="color:#a31515;">security</span><span style="color:blue;">&gt;<br />
</span></span></p>
<p> Basically we are stating that we will use message level security with credential type UserName. To use this setting we need to have SSL connection between client and server. That is a necessary requirement because we will be sending the username and password across the wire in clear text.</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:#2b91af;">EndpointAddress</span> address = <span style="color:blue;">new</span><br />
<span style="color:#2b91af;">EndpointAddress</span>(<span style="color:blue;">new </span><span style="color:#2b91af;">Uri</span>(<span style="color:#a31515;">&#8220;http://localhost:8731/Web.Service/DataService/&#8221;</span>),<br />
</span></p>
<p> The above code is just setting the server host address, nothing special here.</p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
<span style="color:#2b91af;">ChannelFactory</span>&lt;<span style="color:#2b91af;">IDataService</span>&gt; service = <span style="color:blue;">new </span><span style="color:#2b91af;">ChannelFactory</span>&lt;<span style="color:#2b91af;">IDataService</span>&gt;(binding, address);<br />
</span></p>
<p> Here I am creating the <span style="color:#2b91af;font-family:Courier New;font-size:10pt;">ChannelFactory</span> for the particular service implementation.</p>
<p><span style="font-family:Courier New;font-size:10pt;">service.Credentials.UserName.UserName = <span style="color:#a31515;">&#8220;test&#8221;</span>;<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">service.Credentials.UserName.Password = <span style="color:#a31515;">&#8220;test&#8221;</span>;<br />
</span></p>
<p> The above 2 statements is where we need to set the user name and password for the UserName token authentication. Generally these values should be stored in a configuration file or something, but for demonstration purpose I hard-coded them.</p>
<p><span style="font-family:Courier New;font-size:10pt;">service.Credentials.ServiceCertificate.Authentication.CertificateValidationMode = <span style="color:#2b91af;">X509CertificateValidationMode</span>.Custom;<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">service.Credentials.ServiceCertificate.Authentication.CustomCertificateValidator = <span style="color:blue;">new </span><span style="color:#2b91af;">MyX509Validator</span>();<br />
</span></p>
<p> <span style="font-family:Courier New;font-size:10pt;">_service = service.CreateChannel();<br />
</span></p>
<p>Now the above 2 lines are not terribly important. In a production environment the server will have a valid X509 certificate from a certificate authority such as GeoTrust® but for development environment I did not have a certificate so I created a dummy certificate using the following command</p>
<p><span style="color:green;font-family:Courier New;font-size:10pt;">makecert.exe -sr LocalMachine -ss My -a sha1 -n CN=MyServerCert -sky exchange –pe<br />
</span></p>
<p>That means it&#8217;s not a valid certificate. So if you want to bypass the actual server certificate validation (for SSL communication) then you can use the above logic to short circuit the validation.</p>
<p>The code for <span style="color:#2b91af;font-family:Courier New;font-size:10pt;">MyX509Validator</span> is pretty straightforward for demonstration purpose:</p>
<div>
<table style="border-collapse:collapse;" border="0">
<col span="1"></col>
<tbody>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:solid #f9b074 1pt;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">public </span><span style="color:blue;">class </span><span style="color:#2b91af;">MyX509Validator</span> : <span style="color:#2b91af;">X509CertificateValidator</span></strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>{</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">public </span><span style="color:blue;">override </span><span style="color:blue;">void</span> Validate(<span style="color:#2b91af;">X509Certificate2</span> certificate)</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>{</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:green;">// validate argument</span></strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">if</span> (certificate == <span style="color:blue;">null</span>)</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">throw </span><span style="color:blue;">new </span><span style="color:#2b91af;">ArgumentNullException</span>(<span style="color:#a31515;">&#8220;certificate&#8221;</span>);</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"> </td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><br />
<span style="color:green;">// check if the name of the certifcate matches</span></strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">if</span> (certificate.SubjectName.Name != <span style="color:#a31515;">&#8220;CN=MyServerCert&#8221;</span>)</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">throw </span><span style="color:blue;">new </span><span style="color:#2b91af;">SecurityTokenValidationException</span>(<span style="color:#a31515;">&#8220;Certificated was not issued by thrusted issuer&#8221;</span>);</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>}</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>}</strong></span></td>
</tr>
</tbody>
</table>
</div>
<p> That is all you need to create a dynamic proxy with full SSL/UserName token validation. You may ask, why do I need this? I can achieve the same result using configuration files as well? Well as I mentioned this is important for TDD. Here is the testability code:</p>
<p>Dependency Injection:</p>
<p><span style="color:green;font-family:Courier New;font-size:10pt;">// Dependency injection<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">public</span> SearchUserController(<span style="color:#2b91af;">IDataService</span> service, Views.<span style="color:#2b91af;">ISearchUserView</span> view)<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">{<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">_service = service;<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">_view = view;<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">}<br />
</span></p>
<p>The visual Studio Test code is as follows:</p>
<div>
<table style="border-collapse:collapse;" border="0">
<col span="1"></col>
<tbody>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:solid #f9b074 1pt;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>[<span style="color:#2b91af;">TestMethod</span>]</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><br />
<span style="color:blue;">public </span><span style="color:blue;">void</span> TestPortalUserDataControllerIscallingTheServiceAndSettngValueIntoTheView()</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>{</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>MockObjects.<span style="color:#2b91af;">MockISearchUserView</span> view = <span style="color:blue;">new</span> MockObjects.<span style="color:#2b91af;">MockISearchUserView</span>();</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>MockObjects.<span style="color:#2b91af;">MockIDataService</span> service = <span style="color:blue;">new</span> MockObjects.<span style="color:#2b91af;">MockIDataService</span>();</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:#2b91af;">SearchUserController</span> controller = <span style="color:blue;">new</span><br />
<span style="color:#2b91af;">SearchUserController</span>(service, view);</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"> </td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>controller.SearchButton_Click();</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><br />
<span style="color:#2b91af;">Assert</span>.AreEqual(<span style="color:#a31515;">&#8220;Test Bank&#8221;</span>, view._data[0].Bank);</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>}</strong></span></td>
</tr>
</tbody>
</table>
</div>
<p> Pretty straight forward. We need to create 2 mock objects 1 for the view and another for the WCF service. Inject them to the Controller and voila. Here are the mock objects (I did not bother to use any mock framework here, but you can use one).</p>
<div>
<table style="border-collapse:collapse;" border="0">
<col span="1"></col>
<tbody>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:solid #f9b074 1pt;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><br />
<span style="color:blue;">public </span><span style="color:blue;">class </span><span style="color:#2b91af;">MockISearchUserView</span> : <span style="color:#2b91af;">ISearchUserView</span></strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>{</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">public </span><span style="color:blue;">string</span> BankTextBox</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>{</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">get</span></strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>{</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">return </span><span style="color:#a31515;">&#8220;Test&#8221;</span>;</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>}</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">set</span></strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>{</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">throw </span><span style="color:blue;">new </span><span style="color:#2b91af;">NotImplementedException</span>();</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>}</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>}</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>}</strong></span></td>
</tr>
</tbody>
</table>
</div>
<p> And</p>
<div>
<table style="border-collapse:collapse;" border="0">
<col span="1"></col>
<tbody>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:solid #f9b074 1pt;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">public </span><span style="color:blue;">class </span><span style="color:#2b91af;">MockIDataService</span> : <span style="color:#2b91af;">IDataService</span></strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>{</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">#region</span> IPortalDataService Members</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"> </td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><br />
<span style="color:blue;">public </span><span style="color:#2b91af;">GenericCollection</span>&lt;<span style="color:#2b91af;">UserData</span>&gt; GetUsers(<span style="color:blue;">string</span> bankName)</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>{</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:#2b91af;">GenericCollection</span>&lt;<span style="color:#2b91af;">UserData</span>&gt; users = </strong></span><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">new </span><span style="color:#2b91af;">GenericCollection</span>&lt;<span style="color:#2b91af;">UserData</span>&gt;();</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"> </td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:#2b91af;">UserData</span> user = <span style="color:blue;">new</span><br />
<span style="color:#2b91af;">UserData</span>();</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>user.Bank = <span style="color:#a31515;">&#8220;Test Bank&#8221;</span>;</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>users.Add(user);</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"> </td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong><span style="color:blue;">return</span> users;</strong></span></td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>}</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"> </td>
</tr>
<tr style="background:#fbcaa2;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="color:blue;font-family:Courier New;font-size:10pt;"><strong>#endregion</strong></span></td>
</tr>
<tr style="background:#fde4d0;">
<td style="padding-left:7px;padding-right:7px;border-top:none;border-left:solid #f9b074 1pt;border-bottom:solid #f9b074 1pt;border-right:solid #f9b074 1pt;"><span style="font-family:Courier New;font-size:10pt;"><strong>}</strong></span></td>
</tr>
</tbody>
</table>
</div>
<p> Maybe in a future post I can go into detail about the testing things.</p>
<p><span style="font-size:16pt;text-decoration:underline;"><strong>Conclusion:<br />
</strong></span></p>
<p>Here I wanted to demonstrate how you can use the WCF authentication mechanism without generating client proxies. You can use the dynamic proxy functionality provided in WCF to achieve the same results. This is important for the testability reasons as I demonstrated. TDD is a way of coding, if you like it there is no greater thing that happened to software development that this. If you don&#8217;t like it, you will hate it for all the complexity that it brings in. I am in the former camp.</p>
Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anandj123.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anandj123.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anandj123.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anandj123.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anandj123.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anandj123.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anandj123.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anandj123.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anandj123.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anandj123.wordpress.com/247/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=247&subd=anandj123&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anandj123.wordpress.com/2009/04/24/how-to-do-wcf-username-token-authentication-with-dynamic-proxy-for-test-driven-development-tdd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/315119c6bbc10130f64e371b744d30db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anandj123</media:title>
		</media:content>

		<media:content url="http://anandj123.files.wordpress.com/2009/04/042409-1452-howtodowcfu1.png" medium="image" />
	</item>
		<item>
		<title>What is the use of spirituality and why should I follow the path of spirituality?</title>
		<link>http://anandj123.wordpress.com/2009/04/08/what-is-the-use-of-spirituality-and-why-should-i-follow-the-path-of-spirituality/</link>
		<comments>http://anandj123.wordpress.com/2009/04/08/what-is-the-use-of-spirituality-and-why-should-i-follow-the-path-of-spirituality/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 15:26:17 +0000</pubDate>
		<dc:creator>anandj123</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://anandj123.wordpress.com/2009/04/08/what-is-the-use-of-spirituality-and-why-should-i-follow-the-path-of-spirituality/</guid>
		<description><![CDATA[Background:

For the first 30 years of my life I did not find any answers to this first fundamental question and blissfully ignored the second part. I never considered myself an atheist, because deep down I somehow knew there is some force governing the whole thing. I could never accept the answer that the sun and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=245&subd=anandj123&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="font-size:14pt;">Background:<br />
</span></p>
<p>For the first 30 years of my life I did not find any answers to this first fundamental question and blissfully ignored the second part. I never considered myself an atheist, because deep down I somehow knew there is some force governing the whole thing. I could never accept the answer that the sun and moon follow exact same path every day just on their own or by chance.
</p>
<p>My parents gave me name Anand, the literal meaning of the word is bliss. People around me tell me that I do some justice to the name. I have been successful in studies and job and never had to struggle much in life. Kind of cruising thru it all if you can say that. So, I asked myself many times if there is nothing that is bothering me then why should I even consider doing religious activity like going to temple, offering Prasad and doing all other stuff.
</p>
<p>One evening I and one of my friends were having a nice chat about general stuff (movies, sports etc.). He had many years of meditation experience under his belt. He casually asked me if I do any meditation. Instead of answering him I put up a reverse question &#8220;I am generally happy, people who are sad generally do spiritual stuff, why should I consider meditation etc&#8221;. He said, if you enjoy your life then you should consider doing it even so more, because people who do meditation enjoy life even more. Not a strong reply which can convince a lot people but it convinced me. So a potential thought came to me, let&#8217;s give it a try, what&#8217;s the harm.
</p>
<p><span style="font-size:14pt;">After many years of practice:<br />
</span></p>
<p>Now I am 37 and I can say for sure is spirituality definitely the way to go. I learned many things over these years. I am a technical person with a graduate degree in Engineering. My mind works in a structured way, so I will try to analyze the fundamental question in a scientific way and see I can put my experiences/learning in words.
</p>
<p>Q: Why do we need spirituality?
</p>
<p>A: Well because there is pain. If you are suffering from a disease you need to take medicine. Plain and simple.
</p>
<p>Q: How can I say that?
</p>
<p>A: I have felt it in me and most of the people I see around (except for few realized saints). Here are a few examples that I have seen myself.
</p>
<ol>
<li>Consider holding a good paying job (even in this economy), watching a good movie with popcorn, going out golfing every Saturday and enjoying the goodies of life. Where is the pain here? That&#8217;s a tough one right? Wrong, the pain is in the background. That means, even while enjoying the stuff there is always an underlying fear that this will end. Once it ends there is withdrawal symptoms (e.g. why did that good movie end, why can&#8217;t I play another 18 holes of golf etc.) and sometimes depression (If I lose my job and house etc.).
</li>
<li>I have everything that I want (health, wealth, family, job etc.). Life looks good, but it&#8217;s just a struggle to get up and go to work every day. I am not satisfied and things look boring at best. Life seems such a drag. I think it&#8217;s not pain just annoyance right? Wrong again, look around, things are vibrant full of life. Even the deadest things (like a stapler in my desk) are more alive than your mind can comprehend. If you know bit of Particle Physics the scientist will validate to this statement. There are some <a href="http://www.amazon.com/Tao-Physics-Exploration-Parallels-Anniversary/dp/1570625190/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1239200954&amp;sr=8-1">books</a> which can attest to my statement. Read and you will be surprised.
</li>
<li>Ok, I accept there is pain. Common examples, Boss is a pain in the rear end, lost the job, lost a family member etc. You get the picture.
</li>
</ol>
<p>In next post I will try to document extended range of pains written in Hindu and Buddhist scriptures (sorry don&#8217;t know much about other scriptures).
</p>
<p>Q: Well if god is there then why he cannot remove all the pain and we all become happy? He seems to be a cruel guy right?
</p>
<p>A: I don&#8217;t think so. Pain is the background for &#8220;OUR&#8221; happiness.
</p>
<p>Q: How can that be?
</p>
<p>A: Imagine you have a black pen and you need to write something. What do you need? A white piece of paper. Why a white piece, why not a black piece of paper? You must be thinking I am becoming lunatic. No, for to see something we need to have duality (<a href="http://en.wikipedia.org/wiki/Dualism">basic building block for analyzing the problem</a>). If the pen is black we need white background, if the pen is white we need a black background. So when we ask god for happiness, the &#8220;poor guy&#8221; has to create an opposite background so that we can see the happiness against it. Otherwise, why would option b. in the previous question be labeled as pain? Because the background is missing against which all this could be considered world of happiness.
</p>
<p>Q: OK, why god can&#8217;t create happiness where no background of pain is required?
</p>
<p>A: Actually that is the definition of god (sat-chit-ananda). He is all that happiness without duality. This concept cannot be understood by usual methods of learning. Because all concepts reside in mind. And mind works in duality. I will try to document some of the general problems with understanding of this concept clarify my own understanding.
</p>
<p>Q: Well if he is all that, why is he keeping all the fun to himself, why he cannot share that with me?
</p>
<p>A: Wrong QUESTIONER, look at the guy who is asking the question. That guy who is asking the question is defined in the scriptures as ego. That is the source of all pain.
</p>
<p>Q: Well if ego is the source of pain, why not get rid of him. Why so much complicated procedures etc.
</p>
<p>A: Well, once again look at the structure of the question. The guy who wants to get rid of ego is actually the ego. It&#8217;s rather like a spider web. You can keep asking these types of questions and keep on discovering that everything is ego.
</p>
<p>Q: If everything is ego, then who am I?
</p>
<p>A: That is the right question. This question needs to be asked (again and again for many lives sometimes) to get to the core of things. Who ever found the answer they say that they are not different from god. Very sweeping statement, very hard to believe.
</p>
<p>Spirituality is trying to answer that question (Who am I). I will try to write about my own journey (I am still at the foothills of the summit). Sometimes, it&#8217;s just funny to look at the answers that ego provides (or try to survive the onslaught), other times it is very painful (when ego gets hurt or felt diminished and you the real &#8220;I&#8221; deny the reconstruction effort).
</p>
<p><span style="font-size:14pt;">Disclaimer:<br />
</span></p>
<p>I am not an expert on the subject. You should consider me like a blind person and this journey is like climbing Mount Everest. Would you want a blind person to be your guide, I wouldn&#8217;t.
</p>
<p>I have the blessings and infinite grace of <a href="http://www.kalyanika.org/babaji.html">my guru Pujya Baba Kalyandasji Maharaj</a>. He is guiding me and helping me from falling-off of cliffs. So you should never follow anything that is written here. Consider them as fun reading.
</p>
<p>
 </p>
<p>
 </p>
<p>
 </p>
Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anandj123.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anandj123.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anandj123.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anandj123.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anandj123.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anandj123.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anandj123.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anandj123.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anandj123.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anandj123.wordpress.com/245/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=245&subd=anandj123&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anandj123.wordpress.com/2009/04/08/what-is-the-use-of-spirituality-and-why-should-i-follow-the-path-of-spirituality/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/315119c6bbc10130f64e371b744d30db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anandj123</media:title>
		</media:content>
	</item>
		<item>
		<title>Curse of knowledge</title>
		<link>http://anandj123.wordpress.com/2009/04/01/curse-of-knowledge/</link>
		<comments>http://anandj123.wordpress.com/2009/04/01/curse-of-knowledge/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 14:20:29 +0000</pubDate>
		<dc:creator>anandj123</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://anandj123.wordpress.com/2009/04/01/curse-of-knowledge/</guid>
		<description><![CDATA[Richard Feynman, Albert Einstein and others have repeatedly said that:

&#8220;You do not really understand something unless you can explain it to your grandmother.&#8221;

When I was working at Thoughtworks, there was a challenge given to each new hires.

&#8220;Explain dependency injection pattern to the office mailman&#8221;.

That&#8217;s quite a challenge considering I did not know what the pattern [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=229&subd=anandj123&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://en.wikiquote.org/wiki/Richard_Feynman" title="&quot;If I could explain it to the average person, I wouldn't have been worth the Nobel Prize.&quot;"><img src="http://anandj123.files.wordpress.com/2009/04/040109-1420-curseofknow15.jpg" alt=""></a><a href="http://en.wikiquote.org/wiki/Richard_Feynman">Richard Feynman</a>, <a href="http://en.wikiquote.org/wiki/Albert_Einstein">Albert Einstein</a> and others have repeatedly said that:
</p>
<p><span style="font-family:Bradley Hand ITC;"><strong>&#8220;You do not really understand something unless you can explain it to your grandmother.&#8221;<br />
</strong></span></p>
<p>When I was working at <a href="http://www.thoughtworks.com/">Thoughtworks</a>, there was a challenge given to each new hires.
</p>
<p><span style="font-family:Bradley Hand ITC;"><strong>&#8220;Explain dependency injection pattern to the office mailman&#8221;.<br />
</strong></span></p>
<p>That&#8217;s quite a challenge considering I did not know what the pattern was all about at that time. One of the reason I have started writing a blog is to see if I can explain some of the ideas in simple sentences. I have felt many times that I have been a patient of <em>&#8220;Curse of knowledge&#8221;</em> syndrome. You can read more about it <a href="http://michaelmartine.com/2008/08/14/the-curse-of-knowledge-vs-beginners-mind/">here</a>, <a href="http://www.37signals.com/svn/posts/213-the-curse-of-knowledge">here</a> . Hope my effort at writing alleviates the symptoms a little bit.
</p>
<p>Maybe in the next post I will try to explain the &#8220;<a href="http://martinfowler.com/articles/injection.html">Dependency injection pattern</a>&#8221; to my wife (definitely not to grandma).
</p>
<p><a href="http://www.madetostick.com/excerpts/"><img src="http://anandj123.files.wordpress.com/2009/04/040109-1420-curseofknow25.png" alt=""></a><a href="http://www.madetostick.com/excerpts/">Here are few useful tools</a> that might be helpful to me in my monumental effort. Especially <em>&#8220;Principle 6: Stories&#8221;</em></p>
Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anandj123.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anandj123.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anandj123.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anandj123.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anandj123.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anandj123.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anandj123.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anandj123.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anandj123.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anandj123.wordpress.com/229/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=229&subd=anandj123&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anandj123.wordpress.com/2009/04/01/curse-of-knowledge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/315119c6bbc10130f64e371b744d30db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anandj123</media:title>
		</media:content>

		<media:content url="http://anandj123.files.wordpress.com/2009/04/040109-1420-curseofknow15.jpg" medium="image" />

		<media:content url="http://anandj123.files.wordpress.com/2009/04/040109-1420-curseofknow25.png" medium="image" />
	</item>
		<item>
		<title>Chicago museum free days 2009</title>
		<link>http://anandj123.wordpress.com/2009/03/31/chicago-museum-free-days-2009/</link>
		<comments>http://anandj123.wordpress.com/2009/03/31/chicago-museum-free-days-2009/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 17:14:39 +0000</pubDate>
		<dc:creator>anandj123</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://anandj123.wordpress.com/2009/03/31/chicago-museum-free-days-2009/</guid>
		<description><![CDATA[Chicago hot blog maintains a list of free days for Chicago museums. 
Posted in Uncategorized       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=225&subd=anandj123&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.chicagohotblog.com/chicago-museum-free-days"><img src="http://anandj123.files.wordpress.com/2009/03/033109-1714-chicagomuse1.jpg" alt=""></a>Chicago hot blog maintains a list of <a href="http://www.chicagohotblog.com/chicago-museum-free-days">free days for Chicago museums</a>. </p>
Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anandj123.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anandj123.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anandj123.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anandj123.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anandj123.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anandj123.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anandj123.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anandj123.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anandj123.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anandj123.wordpress.com/225/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=225&subd=anandj123&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anandj123.wordpress.com/2009/03/31/chicago-museum-free-days-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/315119c6bbc10130f64e371b744d30db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anandj123</media:title>
		</media:content>

		<media:content url="http://anandj123.files.wordpress.com/2009/03/033109-1714-chicagomuse1.jpg" medium="image" />
	</item>
		<item>
		<title>EuroEnglish</title>
		<link>http://anandj123.wordpress.com/2009/03/27/euroenglish/</link>
		<comments>http://anandj123.wordpress.com/2009/03/27/euroenglish/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 14:39:51 +0000</pubDate>
		<dc:creator>anandj123</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://anandj123.wordpress.com/2009/03/27/euroenglish/</guid>
		<description><![CDATA[The European Union commissioners have announced that agreement has been reached to adopt English as the preferred language for European

communications, rather than German, which was the other possibility. As part of the negotiations, the British government conceded that English spelling had some room for improvement and has accepted a five-year phased plan for what will [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=221&subd=anandj123&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="font-family:Courier New;font-size:9pt;">The European Union commissioners have announced that agreement has been reached to adopt English as the preferred language for European<br />
</span></p>
<p><span style="font-family:Courier New;font-size:9pt;">communications, rather than German, which was the other possibility. As part of the negotiations, the British government conceded that English spelling had some room for improvement and has accepted a five-year phased plan for what will be known as EuroEnglish (Euro for short).<br />
</span></p>
<p><span style="font-family:Courier New;font-size:9pt;">In the first year, &#8220;s&#8221; will be used instead of the soft &#8220;c&#8221;. Sertainly, sivil servants will resieve this news with joy. Also, the hard &#8220;c&#8221; will be replaced with &#8220;k&#8221;. Not only will this klear up konfusion, but typewriters kan have one less letter.<br />
</span></p>
<p><span style="font-family:Courier New;font-size:9pt;">There will be growing publik enthusiasm in the sekond year, when the troublesome &#8220;ph&#8221; will be replaced by &#8220;f&#8221;. This will make words like<br />
</span></p>
<p><span style="font-family:Courier New;font-size:9pt;">&#8220;fotograf&#8221; 20 per sent shorter. In the third year, publik akseptanse of the new spelling kan be expekted to reach the stage where more komplikated changes are possible. Governments will enkorage the removal of double letters, which have always ben a deterent to akurate speling.<br />
</span></p>
<p><span style="font-family:Courier New;font-size:9pt;">Also, al wil agre that the horible mes of silent &#8220;e&#8221;s in the languag is disgrasful, and they would go.<br />
</span></p>
<p><span style="font-family:Courier New;font-size:9pt;">By the fourth year, peopl wil be reseptiv to steps such as replasing &#8220;th&#8221; by &#8220;z&#8221; and &#8220;w&#8221; by &#8221; v&#8221;.<br />
</span></p>
<p><span style="font-family:Courier New;font-size:9pt;">During ze fifz year, ze unesesary &#8220;o&#8221; kan be dropd from vords containing &#8220;ou&#8221;, and similar changes vud of kors be aplid to ozer kombinations of leters.<br />
</span></p>
<p><span style="font-family:Courier New;font-size:9pt;">Und efter ze fifz yer, ve vil al be speking German like zey vunted in ze forst plas.<br />
</span></p>
Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anandj123.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anandj123.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anandj123.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anandj123.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anandj123.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anandj123.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anandj123.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anandj123.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anandj123.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anandj123.wordpress.com/221/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anandj123.wordpress.com&blog=6714739&post=221&subd=anandj123&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://anandj123.wordpress.com/2009/03/27/euroenglish/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/315119c6bbc10130f64e371b744d30db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anandj123</media:title>
		</media:content>
	</item>
	</channel>
</rss>