<?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>Valeriu Caraulean &#187; WCF</title>
	<atom:link href="http://blog.caraulean.com/category/wcf/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.caraulean.com</link>
	<description>Keep it simple. It will work...</description>
	<lastBuildDate>Fri, 10 Feb 2012 04:38:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.caraulean.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Valeriu Caraulean &#187; WCF</title>
		<link>http://blog.caraulean.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.caraulean.com/osd.xml" title="Valeriu Caraulean" />
	<atom:link rel='hub' href='http://blog.caraulean.com/?pushpress=hub'/>
		<item>
		<title>Using WCF without configuration files</title>
		<link>http://blog.caraulean.com/2011/11/16/using-wcf-without-configuration-files/</link>
		<comments>http://blog.caraulean.com/2011/11/16/using-wcf-without-configuration-files/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 23:14:59 +0000</pubDate>
		<dc:creator>Valeriu Caraulean</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">https://varely.wordpress.com/2011/11/16/using-wcf-without-configuration-files/</guid>
		<description><![CDATA[I have recently published new project on GitHub, WcfWithoutConfigFile. This post is intended as a ‘readme’ file for this repository. It’s just a collection of simple projects that I’ve put together when a coworker asked me to show how he can use WCF without configuration files. He got feed up working with XML in web.config [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.caraulean.com&amp;blog=1485392&amp;post=350&amp;subd=varely&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have recently published new project on GitHub, <a href="http://github.com/vcaraulean/WcfWithoutConfigFile">WcfWithoutConfigFile</a>. This post is intended as a ‘readme’ file for this repository.</p>
<p>It’s just a collection of simple projects that I’ve put together when a coworker asked me to show how he can use WCF without configuration files. He got feed up working with XML in web.config and wanted a cleaner and more understandable way to configure Windows Communication Foundation.</p>
<p>What’s in:</p>
<ul>
<li>How to use WCF in your unit tests (<a href="http://github.com/vcaraulean/WcfWithoutConfigFile/tree/master/WcfWithoutConfigFile.Tests">WcfWithoutConfigFile.Tests</a> project). Sometimes you want to get your code tested at service boundaries and you want to involve also WCF. It contains, among a simple unit test, a base class for your tests so the test cases are clean and don’t contain plumbing code.
<li>Hosting WCF services in IIS (<a href="http://github.com/vcaraulean/WcfWithoutConfigFile/tree/master/WcfWithoutConfigFile.WebHost">WcfWithoutConfigFile.WebHost</a> project). Defining the service in .svc files and all required infrastructure to instantiate the service via code-only configuration.
<li><strong>My favorite</strong> – hosting WCF service in IIS using Castle’s <a href="http://www.castleproject.org/container/facilities/trunk/wcf/index.html">WcfIntegration facility</a>&nbsp; (<a href="https://github.com/vcaraulean/WcfWithoutConfigFile/tree/master/WcfWithoutConfigFile.WebHost.Castle">WcfWithoutConfigFile.WebHost.Castle</a> project). It leverages Castle Windsor container and WcfFacility to easily host/run/consume your WCF services. It also configures the service to use Windows authentication and shows how to retrieve client’s WindowsIdentity in the service. There is also a client project, <a href="https://github.com/vcaraulean/WcfWithoutConfigFile/tree/master/WcfWithoutConfigFile.WebHost.Castle-Client">WcfWithoutConfigFile.WebHost.Castle-Client</a> that connects to service and does some operations.</li>
</ul>
<p><a href="https://github.com/vcaraulean/WcfWithoutConfigFile/tree/master/WcfWithoutConfigFile.WebHost.Castle">WcfWithoutConfigFile.WebHost.Castle</a> requires some configuration to get it working properly. Be sure to:</p>
<ul>
<li>Run it in IIS Express
<li>Enable Windows Authentication in project properties</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/varely.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/varely.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/varely.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/varely.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/varely.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/varely.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/varely.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/varely.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/varely.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/varely.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/varely.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/varely.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/varely.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/varely.wordpress.com/350/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.caraulean.com&amp;blog=1485392&amp;post=350&amp;subd=varely&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.caraulean.com/2011/11/16/using-wcf-without-configuration-files/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5d96a7814c830eb5ee8e12b677212cae?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">varely</media:title>
		</media:content>
	</item>
		<item>
		<title>WCF Security Guidance</title>
		<link>http://blog.caraulean.com/2008/03/28/wcf-security-guidance/</link>
		<comments>http://blog.caraulean.com/2008/03/28/wcf-security-guidance/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 09:44:31 +0000</pubDate>
		<dc:creator>Valeriu Caraulean</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://varely.wordpress.com/2008/03/28/wcf-security-guidance/</guid>
		<description><![CDATA[It seems to be that Patterns &#38; Practices team continues to do what they do the best &#8211; creating guidance within different development areas. The last release of this group is the WCF Security Guidance. It contains description for a few application scenarios &#38; a list of various How-Tos, including few video walkthroughs of common [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.caraulean.com&amp;blog=1485392&amp;post=17&amp;subd=varely&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It seems to be that Patterns &amp; Practices team continues to do what they do the best &#8211; creating guidance within different development areas. </p>
<p>The last release of this group is the <a href="http://www.codeplex.com/WCFSecurity/">WCF Security Guidance</a>. It contains description for a few application scenarios &amp; a list of various How-Tos, including few video walkthroughs of common WCF solutions.</p>
<p>It&#8217;s different from usual way to dig into WCF infrastructure details. It&#8217;s not crawling over hundreds of MSDN pages, it&#8217;s not like reading MSDN samples trying to understand what&#8217;s going on.</p>
<p>It is a very detailed step-by-step description on how to do some tasks touching different aspects of WCF, starting from opening a certificates store, and ending with deployment advices.</p>
<p>Keep it going, P&amp;P!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/varely.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/varely.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/varely.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/varely.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/varely.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/varely.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/varely.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/varely.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/varely.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/varely.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/varely.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/varely.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/varely.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/varely.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/varely.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/varely.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.caraulean.com&amp;blog=1485392&amp;post=17&amp;subd=varely&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.caraulean.com/2008/03/28/wcf-security-guidance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5d96a7814c830eb5ee8e12b677212cae?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">varely</media:title>
		</media:content>
	</item>
		<item>
		<title>HttpContext idiom for Windows Communication Foundation.</title>
		<link>http://blog.caraulean.com/2008/02/13/httpcontext-idiom-for-windows-communication-foundation/</link>
		<comments>http://blog.caraulean.com/2008/02/13/httpcontext-idiom-for-windows-communication-foundation/#comments</comments>
		<pubDate>Wed, 13 Feb 2008 14:13:37 +0000</pubDate>
		<dc:creator>Valeriu Caraulean</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://varely.wordpress.com/2008/02/13/httpcontext-idiom-for-windows-communication-foundation/</guid>
		<description><![CDATA[WCF infrastructure allows you to store context sensitive data in InstanceContext of the service instance. For that you should implement from IExtension&#60;InstanceContext&#62; and plug that class into WCF&#8217;s infrastructure in any of available ways. When I worked on a class that can store contextual information in Web context or WCF context depending on some configuration [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.caraulean.com&amp;blog=1485392&amp;post=15&amp;subd=varely&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>WCF infrastructure allows you to store context sensitive data in InstanceContext of the service instance. For that you should implement from IExtension&lt;InstanceContext&gt; and plug that class into WCF&#8217;s infrastructure in any of available ways. </p>
<p>When I worked on a class that can store contextual information in Web context or WCF context depending on some configuration parameters, I preferred to have similar idioms, and I wrote an HttpContext-like class for WCF.</p>
<pre><span style="color:gray;">///&lt;summary&gt;
/// </span><span style="color:green;">This class incapsulates context information for a service instance
</span><span style="color:gray;">///&lt;/summary&gt;
</span><span style="color:blue;">public class </span><span style="color:#2b91af;">WcfInstanceContext </span>: <span style="color:#2b91af;">IExtension</span>&lt;<span style="color:#2b91af;">InstanceContext</span>&gt;
{
    <span style="color:blue;">private readonly </span><span style="color:#2b91af;">IDictionary </span>items;

    <span style="color:blue;">private </span>WcfInstanceContext()
    {
        items = <span style="color:blue;">new </span><span style="color:#2b91af;">Hashtable</span>();
    }

    <span style="color:gray;">///&lt;summary&gt;
    /// &lt;see cref="IDictionary"/&gt; </span><span style="color:green;">stored in current instance context.
    </span><span style="color:gray;">///&lt;/summary&gt;
    </span><span style="color:blue;">public </span><span style="color:#2b91af;">IDictionary </span>Items
    {
        <span style="color:blue;">get </span>{ <span style="color:blue;">return </span>items; }
    }

    <span style="color:gray;">///&lt;summary&gt;
    /// </span><span style="color:green;">Gets the current instance of </span><span style="color:gray;">&lt;see cref="WcfInstanceContext"/&gt;
    ///&lt;/summary&gt;
    </span><span style="color:blue;">public static </span><span style="color:#2b91af;">WcfInstanceContext </span>Current
    {
        <span style="color:blue;">get
        </span>{
            <span style="color:#2b91af;">WcfInstanceContext </span>context = <span style="color:#2b91af;">OperationContext</span>.Current.InstanceContext.Extensions.Find&lt;<span style="color:#2b91af;">WcfInstanceContext</span>&gt;();
            <span style="color:blue;">if </span>(context == <span style="color:blue;">null</span>)
            {
                context = <span style="color:blue;">new </span><span style="color:#2b91af;">WcfInstanceContext</span>();
                <span style="color:#2b91af;">OperationContext</span>.Current.InstanceContext.Extensions.Add(context);
            }
            <span style="color:blue;">return </span>context;
        }
    }

    <span style="color:gray;">/// &lt;summary&gt;
    /// &lt;see cref="IExtension{T}"/&gt; </span><span style="color:green;">Attach() method
    </span><span style="color:gray;">/// &lt;/summary&gt;
    </span><span style="color:blue;">public void </span>Attach(<span style="color:#2b91af;">InstanceContext </span>owner) { }

    <span style="color:gray;">/// &lt;summary&gt;
    /// &lt;see cref="IExtension{T}"/&gt; </span><span style="color:green;">Detach() method
    </span><span style="color:gray;">/// &lt;/summary&gt;
    </span><span style="color:blue;">public void </span>Detach(<span style="color:#2b91af;">InstanceContext </span>owner) { }

}</pre>
<p>Now, you can use this class to store and retrieve data in the same manner as you&#8217;re working with HttpContext:</p>
<pre>    WcfInstanceContext.Current.Items[<span style="color:rgb(163,21,21);">"key"</span>] = <span style="color:rgb(0,0,255);">new</span> MyClass();
    MyClass myClass = WcfInstanceContext.Current.Items[<span style="color:rgb(163,21,21);">"key"</span>] <span style="color:rgb(0,0,255);">as</span> MyClass;
</pre>
<p><a href="http://11011.net/software/vspaste"><a href="http://11011.net/software/vspaste"></a></p>
<p>&nbsp;</p>
<p>Of course, when doing this you should be inside of WCF session&#8230;</p>
<p>Enjoy!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/varely.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/varely.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/varely.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/varely.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/varely.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/varely.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/varely.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/varely.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/varely.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/varely.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/varely.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/varely.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/varely.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/varely.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/varely.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/varely.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.caraulean.com&amp;blog=1485392&amp;post=15&amp;subd=varely&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.caraulean.com/2008/02/13/httpcontext-idiom-for-windows-communication-foundation/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5d96a7814c830eb5ee8e12b677212cae?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">varely</media:title>
		</media:content>
	</item>
	</channel>
</rss>
