<?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>Real WCF and SOA experience</title>
	<atom:link href="http://realwcf.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://realwcf.wordpress.com</link>
	<description>Contribution to the debate around WCF and SOA</description>
	<lastBuildDate>Sat, 03 Jan 2009 23:14:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='realwcf.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Real WCF and SOA experience</title>
		<link>http://realwcf.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://realwcf.wordpress.com/osd.xml" title="Real WCF and SOA experience" />
	<atom:link rel='hub' href='http://realwcf.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Make your own WCF Client</title>
		<link>http://realwcf.wordpress.com/2009/01/03/make-your-own-wcf-client/</link>
		<comments>http://realwcf.wordpress.com/2009/01/03/make-your-own-wcf-client/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 20:37:33 +0000</pubDate>
		<dc:creator>nikolajr</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Service Reference]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://realwcf.wordpress.com/?p=12</guid>
		<description><![CDATA[The standard way of obtaining a WCF client that corresponds to a WCF service is to use the Service Reference utility of VS 2008 (or VS 2005). This is a fine way of generating a quick out-of-the-box proxy client that provides what is needed to communicate with the service. When you dig into what is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=realwcf.wordpress.com&amp;blog=6037242&amp;post=12&amp;subd=realwcf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The standard way of obtaining a WCF client that corresponds to a WCF service is to use the Service Reference utility of VS 2008 (or VS 2005). This is a fine way of generating a quick out-of-the-box proxy client that provides what is needed to communicate with the service.</p>
<p>When you dig into what is provided for you, you find a fairly straight forward implemented file called reference.cs containing an extension of the ClientBase class as well as an implementation of the service contract exposed by the service. Included in the same file is all DataContracts involved in methods provided by the service. Additionally, an application config file is created (if not already present) including a huge amount of settings – all reflecting the corresponding service settings.</p>
<p>The generated lot will suffice in scenarios where you start out using WCF and try to get a grasp of it. This is fine when you have a regular A calls B calls C chain of services. C exposes the DataContract D1 so B will one Service Reference to C and A will have another Service Reference to B. Actually this means that the DataContract D1 is implemented three times each one with an individual namespace.</p>
<p>Now trouble realises its ugly head when you occasionally need to call service C from service A. To facilitate this, a new Service Reference is added to service A providing a new implementation of the DataContract D1. Obviously, this additional implementation is truly unnecessary and moreover the namespace is different from the namespace obtained from the Service Reference to service B. This makes the two implementations of DataContract D1 incompatible even though they actually origin from the same class.<br />

<a href='http://realwcf.wordpress.com/2009/01/03/make-your-own-wcf-client/services1/' title='Services in a straight call chain'><img data-attachment-id='23' data-orig-size='276,463' data-liked='0'width="57" height="96" src="http://realwcf.files.wordpress.com/2009/01/services1.png?w=57&#038;h=96" class="attachment-thumbnail" alt="Services in a straight call chain" title="Services in a straight call chain" /></a>
<a href='http://realwcf.wordpress.com/2009/01/03/make-your-own-wcf-client/services21/' title='Services with alternate call chain'><img data-attachment-id='26' data-orig-size='439,463' data-liked='0'width="91" height="96" src="http://realwcf.files.wordpress.com/2009/01/services21.png?w=91&#038;h=96" class="attachment-thumbnail" alt="Services with alternate call chain" title="Services with alternate call chain" /></a>
<br />
The generated configurations are also duplicated for each Service Reference and are placed in the project that contains the Service Reference. But if your project containing the Service References isn&#8217;t the project hosting your client you need to move these new configuration settings each time you update your Service Reference.</p>
<p>I know you can try to tweek the way Service References can be made by forcing reuse of already generated references. But it&#8217;s a hassle and to my experience it rarely works as expected.</p>
<p>What I suggest is to drop the use of auto generated Service References. Instead, place all Service Contracts in one project, place all DataContracts in another (or optionally the same) project and let both the services and the clients reference these projects. Next you implement your own proxy client classes, which is done fairly easy (see the following listing).</p>
<pre>[DataContract]
public class DataContractD1
{
    [DataMember]
    public string MyData { get; set; }
}
[ServiceContract]
public interface IAService
{
    [OperationContract]
    void AddMyData(DataContractD1 data);
}
public class Client1 : ClientBase&lt;IAService&gt;, IAService
{
    public void AddMyData(DataContractD1 data)
    {
        Channel.AddMyData(data);
    }
}</pre>
<p>What is missing is altering the configuration file as exemplified in the following listing.</p>
<pre>&lt;client&gt;
  &lt;endpoint
      address="net.tcp://localhost:7001/AService"
      binding="netTcpBinding"
      contract="MyServices.IAService"/&gt;
&lt;/client&gt;</pre>
<p>This is basically what is to it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/realwcf.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/realwcf.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/realwcf.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/realwcf.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/realwcf.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/realwcf.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/realwcf.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/realwcf.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/realwcf.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/realwcf.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/realwcf.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/realwcf.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/realwcf.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/realwcf.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=realwcf.wordpress.com&amp;blog=6037242&amp;post=12&amp;subd=realwcf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://realwcf.wordpress.com/2009/01/03/make-your-own-wcf-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b68ea80816756f2f24201f0782609c78?s=96&#38;d=identicon" medium="image">
			<media:title type="html">nikolajr</media:title>
		</media:content>

		<media:content url="http://realwcf.files.wordpress.com/2009/01/services1.png?w=57" medium="image">
			<media:title type="html">Services in a straight call chain</media:title>
		</media:content>

		<media:content url="http://realwcf.files.wordpress.com/2009/01/services21.png?w=91" medium="image">
			<media:title type="html">Services with alternate call chain</media:title>
		</media:content>
	</item>
		<item>
		<title>WCF is about lightweight Service Orientation and not only Web Services</title>
		<link>http://realwcf.wordpress.com/2009/01/03/wcf-is-about-lightweight-service-orientation-and-not-only-web-services/</link>
		<comments>http://realwcf.wordpress.com/2009/01/03/wcf-is-about-lightweight-service-orientation-and-not-only-web-services/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 14:43:48 +0000</pubDate>
		<dc:creator>nikolajr</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[A couple a years have passed by since Microsoft released their .NET 3.0 introducing Windows Communication Foundation (and other Foundations). When WCF was introduced, Microsoft gave you the impression that WCF is about wrapping the old .asmx files into some more appealing coloured paper. But using WCF as a web service interface is like using [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=realwcf.wordpress.com&amp;blog=6037242&amp;post=1&amp;subd=realwcf&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:black;">A couple a years have passed by since Microsoft released their .NET 3.0 introducing Windows Communication Foundation (and other Foundations). When WCF was introduced, Microsoft gave you the impression that WCF is about wrapping the old .asmx files into some more appealing coloured paper. But using WCF as a web service interface is like using Windows only as a browser &#8211; and nothing else. This is really too bad since WCF provides a lot more.<br />
</span></p>
<p><span style="color:black;">WCF provides a nice group of binding types that facilitate not only old-fashioned SOAP-calls via HTTP/HTTPS, but also more efficient binding types using protocols like TCP and ICP. The elegant part is that each service can be exposed using several endpoints each featuring its own protocol coupled with several other features. The web service based binding types provide several SOAP features like REST, federated security, duplex and more. Also some of the binding types provide reliability, transactions, call backs and queuing. And if you realise that the binding types available don&#8217;t apply you can fairly easy write your own binding type since WCF is written for extendability. Alternatively, you can find a suitable provider of binding types that tend to pop up (like <a href="http://www.noemax.com" target="_blank">Noemax</a> or <a href="http://www.rabbitmq.com/" target="_blank">RabbitMQ</a>).<br />
</span></p>
<p><span style="color:black;">I don&#8217;t intend to go into further technical details with the specifics of WCF in this article &#8211; if interested please look <a href="http://msdn.microsoft.com/en-us/library/ms735119.aspx" target="_blank">here</a>. Far more interesting is the architectural options that WCF inherently provides.<br />
</span></p>
<p><span style="color:black;">Given the fact that Moore&#8217;s law doesn&#8217;t apply anymore, since processor cores don&#8217;t get much faster, processors will tend to include ever more cores. To take advantage of this development, software needs to be able to work in parallel and in multiple threads. WCF has an interesting support for that.<br />
</span></p>
<p><span style="color:black;">Between 70% and 85% of development time is typically spent on plumbing &#8211; known as logging, transaction management, security, error handling and threading. Working on plumbing is required in order to assure secure, reliable and available solutions, but it doesn&#8217;t bring you any closer to deliver the correct business code or UI code. Amazingly, WCF has an interesting support for that as well.<br />
</span></p>
<p><span style="color:black;">Picture yourself designing services in an architectural field. Imagine that you don&#8217;t write classes &#8211; you write services declaring the features and aspects that you need. If you need to change a feature or an aspect, you change the properties declared with it and that&#8217;s it. In this world, services become a logical and physical wrapping around your precious business logic. This is an interesting and compelling concept of WCF.<br />
</span></p>
<p><span style="color:black;">The normal concept of services is that services are something that delivers a well defined access to resources. So far we&#8217;ve been used to huge Application Servers delivering Enterprise level SOA to the industry (randomly mentioning: <a href="http://www-01.ibm.com/software/websphere/" target="_blank">WebSphere</a>, <a href="http://www.oracle.com/technology/tech/soa/index.html" target="_blank">Oracle SOA Suite</a>, <a href="http://www.bea.com/framework.jsp?CNT=index.htm&amp;FP=/content/products/weblogic/server" target="_blank">Oracle BEA WebLogic</a>, <a href="http://www.microsoft.com/biztalk/en/us/default.aspx" target="_blank">Microsoft Biztalk</a> and partly <a href="http://www.jboss.org/" target="_blank">JBoss</a>). All of them are targeted mainly for the major Enterprise level of companies requiring major economical, technical and resource investments to realise.<br />
</span></p>
<p><span style="color:black;">But what if services are lightweight, easy to host, easy to run and light on resources? Admitted, this is undeniably a compelling opportunity to bring SOA to a much wider range of applications and solutions throughout the industry. My point here is that it really points down to what WCF is about.<br />
</span></p>
<p><span style="color:black;">Actually, you can use services as a platform that goes beyond the resource service station and into the world of frontends. Nowadays, you expect your desktop client applications to be available and responsive even when querying for large amounts of data. Of course we have threads to handle concurrency and asynchronous calls but thread management and the world of deadlock is catching up. Services brings you availability and responsibility and this can easily be incorporated into your desktop client applications – interesting but not necessarily applicable in all situations.<br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/realwcf.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/realwcf.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/realwcf.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/realwcf.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/realwcf.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/realwcf.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/realwcf.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/realwcf.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/realwcf.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/realwcf.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/realwcf.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/realwcf.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/realwcf.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/realwcf.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=realwcf.wordpress.com&amp;blog=6037242&amp;post=1&amp;subd=realwcf&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://realwcf.wordpress.com/2009/01/03/wcf-is-about-lightweight-service-orientation-and-not-only-web-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b68ea80816756f2f24201f0782609c78?s=96&#38;d=identicon" medium="image">
			<media:title type="html">nikolajr</media:title>
		</media:content>
	</item>
	</channel>
</rss>
