<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://bloggingabout.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tag 'Test Harness'</title><link>http://bloggingabout.net/search/SearchResults.aspx?a=1&amp;o=DateDescending&amp;tag=Test+Harness&amp;orTags=0</link><description>Search results matching tag 'Test Harness'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>WCF Test Harness: Release 1.2.2.0</title><link>http://bloggingabout.net/blogs/chilberto/archive/2009/04/01/wcf-test-harness-release-1-2-2-0.aspx</link><pubDate>Wed, 01 Apr 2009 07:55:51 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:481449</guid><dc:creator>chilberto</dc:creator><description>&lt;p&gt;A new version of the &lt;a href="http://www.codeplex.com/WCFTestHarness" target="_blank"&gt;test harness&lt;/a&gt; has been added to codeplex.&amp;#160; &lt;/p&gt;  &lt;p&gt;This release corrects some bugs and adds some new usability features (e.g., the ability to edit the client configuration via a menu item).&lt;/p&gt;  &lt;p&gt;Feedback appreciated.&lt;/p&gt;</description></item><item><title>WCF Test Harness: Release 1.1.1.1</title><link>http://bloggingabout.net/blogs/chilberto/archive/2009/02/24/wcf-test-harness-release-1-1-1-1.aspx</link><pubDate>Tue, 24 Feb 2009 03:11:21 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:481218</guid><dc:creator>chilberto</dc:creator><description>&lt;p&gt;The WCF Test Harness has been &lt;a href="http://www.codeplex.com/WCFTestHarness/Release/ProjectReleases.aspx?ReleaseId=23714" target="_blank"&gt;updated&lt;/a&gt;.&amp;nbsp; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;The previous version would fail to build the dynamic proxy for some services.&amp;nbsp; In particular BizTalk isolated host service endpoints.&amp;nbsp; The new version will still attempt to build the proxy even if warnings are encountered when downloading the metadata.&lt;/li&gt; &lt;li&gt;This version uses an untyped channel to send the requests and responses (see below).&amp;nbsp; This allows for the messages to be more easily constructed and for more flexibility (or leniency) on the receive.&amp;nbsp; As a test tool this is useful for debugging and determining when an application does not conform to the metadata.&amp;nbsp; For example, the subtle differences between Java and .Net base soap solutions.&lt;/li&gt; &lt;li&gt;DataContractSerialization is now used for building the input message.&lt;/li&gt;&lt;/ul&gt; &lt;h3&gt;Untyped Channel&lt;/h3&gt; &lt;p&gt;After a TestCase has been created that indicates the contract to call and the input, the InvokeProxyMethod method is used to call the service using an untyped channel.&amp;nbsp; By untyped, I mean conforming to the following signature:&lt;/p&gt; &lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt; &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;[ServiceContract]&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;interface&lt;/span&gt; IUntypedChannel&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;{&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    [OperationContract(Action = &lt;span style="color:#006080;"&gt;&amp;quot;*&amp;quot;&lt;/span&gt;, ReplyAction = &lt;span style="color:#006080;"&gt;&amp;quot;*&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    Message Post(Message content);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The following code is used to create a ContractChannelFactory&amp;lt;T&amp;gt; using reflection.&amp;nbsp; Reflection is necessary as the contract type (T) is not known until runtime.&amp;nbsp; The ContractChannelFactory is based on the ClientChannelFactory&amp;lt;T&amp;gt; from the Microsoft WCF Samples.&amp;nbsp; The main difference is it can be used to create a IUntypedChannel channel.&amp;nbsp; This can be used to post a Message based on the contract type&amp;#39;s message properties.&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;
&lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; InvokeProxyMethod(TestCase test)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;{&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; ret = &lt;span style="color:#006080;"&gt;&amp;quot;Failed to call test case...&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    &lt;span style="color:#008000;"&gt;// determine the contract type&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    ServiceClientContract contract = _contracts[test.ContractName];&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    ClientEndpoint endpoint = contract.Endpoints[test.EndpointName];&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    Type contractType = Assemblies[test.Assembly].GetType(endpoint.Contract);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    &lt;span style="color:#008000;"&gt;// create the factory to generate the channel&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    Type factoryType = &lt;span style="color:#0000ff;"&gt;typeof&lt;/span&gt;(ContractChannelFactory&amp;lt;&amp;gt;).MakeGenericType(contractType);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    Object factory = Activator.CreateInstance(factoryType, &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;object&lt;/span&gt;[] {test.EndpointName, contract.FileName});&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;   &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    &lt;span style="color:#008000;"&gt;// create the channel&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    IUntypedChannel channel = (IUntypedChannel)factoryType.InvokeMember(&lt;span style="color:#006080;"&gt;&amp;quot;CreateUntypedChannel&amp;quot;&lt;/span&gt;, BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.Instance, &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;, factory, &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;object&lt;/span&gt;[] { test.URL });&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    &lt;span style="color:#008000;"&gt;// determine the action&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    MemberInfo s = contractType.GetMethod(test.Method);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    &lt;span style="color:#0000ff;"&gt;object&lt;/span&gt;[] attributes = s.GetCustomAttributes(&lt;span style="color:#0000ff;"&gt;typeof&lt;/span&gt;(OperationContractAttribute), &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (attributes.Length == 1)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;        &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; (StringReader sr = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; StringReader(test.Input))&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;        {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;            &lt;span style="color:#008000;"&gt;// build an untyped message with the same message version, input and action&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;            XmlReader xr = XmlTextReader.Create(sr);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;            OperationContractAttribute attribute = (OperationContractAttribute)attributes[0];&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;            MessageVersion version = (MessageVersion)factoryType.InvokeMember(&lt;span style="color:#006080;"&gt;&amp;quot;GetMessageVersion&amp;quot;&lt;/span&gt;, BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.Instance, &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;, factory, &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;object&lt;/span&gt;[] { });&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;            Message request = Message.CreateMessage(version, attribute.Action, xr);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;            &lt;span style="color:#008000;"&gt;// call the service&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;            Message response = channel.Post(request);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;            ret = response.ToString();&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;            xr.Close();&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;            sr.Close();&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;        }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; ret;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h3&gt;&lt;/h3&gt;
&lt;h3&gt;ContractChannelFactory&amp;lt;T&amp;gt;&lt;/h3&gt;
&lt;p&gt;The ContractChannelFactory&amp;lt;T&amp;gt; is used to build the ChannelFactory&amp;lt;T&amp;gt; using a supplied configuration file.&amp;nbsp; The new methods, CreateUntypedChanee() and GetMessageVersion() are used to create a channel that will send a untyped message.&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;
&lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; ContractChannelFactory&amp;lt;T&amp;gt; : ChannelFactory&amp;lt;T&amp;gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;{&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    &lt;span style="color:#008000;"&gt;// contructor and methods to build channelfactory based on supplied configuration file&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    ...&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; IUntypedChannel CreateUntypedChannel(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; overrideUrl)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;        EndpointAddress address = &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.Endpoint.Address;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;          &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;        &lt;span style="color:#008000;"&gt;// if an override then take the new address&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt;(overrideUrl!=&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;.Empty)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;            address = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; EndpointAddress(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; Uri(overrideUrl), address.Identity, address.Headers, address.GetReaderAtMetadata(), address.GetReaderAtExtensions());&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;        ChannelFactory&amp;lt;IUntypedChannel&amp;gt; factory = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; ChannelFactory&amp;lt;IUntypedChannel&amp;gt;(&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.Endpoint.Binding, address);            &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; factory.CreateChannel();&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; MessageVersion GetMessageVersion()&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.Endpoint.Binding.MessageVersion;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;  }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</description></item><item><title>WCF Test Harness: DynamicProxyFactory</title><link>http://bloggingabout.net/blogs/chilberto/archive/2009/01/19/wcf-test-harness-dynamicproxyfactory.aspx</link><pubDate>Mon, 19 Jan 2009 22:27:49 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:481033</guid><dc:creator>chilberto</dc:creator><description>&lt;p&gt;This is in response to a &lt;a href="http://www.codeplex.com/WCFTestHarness/Thread/View.aspx?ThreadId=44396" target="_blank"&gt;post&lt;/a&gt; on CodePlex in regards to how to retrieve the metadata of a service.&amp;nbsp; I based this on a WCF Sample create by Vipul Modi.&lt;/p&gt; &lt;h2&gt;&lt;/h2&gt; &lt;h4&gt;DynamicProxyFactory&lt;/h4&gt; &lt;p&gt;In the WCF Test Harness solution, the DynamicProxyFactory class is used to generate a proxy class based on a metadata enabled service.&amp;nbsp; The class performs the following: &lt;/p&gt; &lt;ol&gt; &lt;li&gt;Downloads Metadata - uses the System.Web.Services.Discovery.DiscoveryClientProtocol to retrieve the metadata&lt;/li&gt; &lt;li&gt;Imports Metadata - uses the System.ServiceModel.Description.WsdlImporter to extract the bindings, contracts and endpoints&lt;/li&gt; &lt;li&gt;Creates Proxy - generates the proxy code &lt;/li&gt; &lt;li&gt;Writes Proxy - writes the code into memory&lt;/li&gt; &lt;li&gt;Compiles - compiles the proxy code into a temporary assembly&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;If you are interested in exploring this, I suggest retrieving the source code and investigating the classes located in the Dynamic folder of the Spike.ContractBuilder library.&lt;/p&gt; &lt;p&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_2.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="165" alt="image" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_thumb.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Cheers, Jeff&lt;/p&gt;</description></item><item><title>WCF Test Harness: Creating a Stub Service</title><link>http://bloggingabout.net/blogs/chilberto/archive/2008/12/09/wcf-test-harness-creating-a-stub-service.aspx</link><pubDate>Tue, 09 Dec 2008 00:03:00 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:477328</guid><dc:creator>chilberto</dc:creator><description>&lt;p&gt;The following steps can be performed to create a stub service based on the service contract downloaded and compiled in &lt;a target="_blank" href="http://bloggingabout.net/blogs/chilberto/pages/wcf-test-harness-adding-a-new-proxy-via-url.aspx"&gt;Add a New Proxy via URL&lt;/a&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select the menu option Show Hosting Window on the Host menu.&amp;nbsp; This will bring up a non-modal dialog that can be used to manage stubbed services.&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_2.png"&gt;&lt;img border="0" width="206" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_thumb.png" alt="image" height="56" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&amp;nbsp; Select the Add Service Contract menu option on the Host menu of the Hosting Window:&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_4.png"&gt;&lt;img border="0" width="244" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_thumb_5F00_1.png" alt="image" height="76" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;In the dialog, enter in a unique name for the service, select a service contract, and provide an address for the service:&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_6.png"&gt;&lt;img border="0" width="461" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_thumb_5F00_2.png" alt="image" height="208" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Next, click Create Stub to generate an implementation of the service contract:&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_10.png"&gt;&lt;img border="0" width="158" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_thumb_5F00_4.png" alt="image" height="115" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;This will generate a metadata enabled service endpoint at the address specified.&amp;nbsp; Click the Start button to create and open the host:&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_12.png"&gt;&lt;img border="0" width="374" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_thumb_5F00_5.png" alt="image" height="214" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;If the TestHost.exe is currently running, you will get a failure as the Uri has already been allocated:&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_14.png"&gt;&lt;img border="0" width="649" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_thumb_5F00_6.png" alt="image" height="101" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Stop the TestHost by pressing return in the consol application window:&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_16.png"&gt;&lt;img border="0" width="400" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_thumb_5F00_7.png" alt="image" height="116" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Click the Start button again.&amp;nbsp; The host is now running...&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a target="_blank" href="http://bloggingabout.net/blogs/chilberto/pages/wcf-test-harness-overview.aspx"&gt;Overview&lt;/a&gt;&lt;/p&gt;</description></item><item><title>WCF Test Harness: New Release</title><link>http://bloggingabout.net/blogs/chilberto/archive/2008/12/09/wcf-test-harness-new-release.aspx</link><pubDate>Mon, 08 Dec 2008 23:52:00 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:477327</guid><dc:creator>chilberto</dc:creator><description>&lt;p&gt;I&amp;#39;ve created a new version of the &lt;a target="_blank" href="http://www.codeplex.com/WCFTestHarness"&gt;WCF Test Harness&lt;/a&gt; including some bug fixes and the ability to create a mock host.&amp;nbsp; This is a stubbed service based on a&amp;nbsp; loaded service contract.&amp;nbsp; This is very limited and its main purpose is to illustrate what is possible.&amp;nbsp; If this proves to be useful, I&amp;#39;ll flush it out and work on its limitations and spend some time on the GUI.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note: This replaces the previous version and is not compatible with the previous version (including the SampleHost.exe).&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With this new release it is possible to perform the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;First create a new client configuration and proxy by following: &lt;a target="_blank" href="http://bloggingabout.net/blogs/chilberto/pages/wcf-test-harness-adding-a-new-proxy-via-url.aspx"&gt;Add a New Proxy via Url&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Add a new test case and verify the service is valid by following: &lt;a target="_blank" href="http://bloggingabout.net/blogs/chilberto/pages/wcf-test-harness-createing-a-new-test-case.aspx"&gt;Creating a New Test Case&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Create a stubbed service based on the service contract downloaded in Step 1: &lt;a href="http://bloggingabout.net/blogs/chilberto/archive/2008/12/09/wcf-test-harness-creating-a-stub-service.aspx" title="Creating a Stub Service"&gt;Creating a Stub Service&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;After stopping the TestHost service running, run the test created in Step 2 again.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This does have potential for being really useful.&amp;nbsp; The next step is to apply the test harness against some real-world services to see where the holes are...&lt;/p&gt;
&lt;p&gt;As always, any feedback or suggestions appreciated. &lt;/p&gt;</description></item><item><title>WCF Test Harness: Sample Contract</title><link>http://bloggingabout.net/blogs/chilberto/archive/2008/11/21/guide-1.aspx</link><pubDate>Fri, 21 Nov 2008 01:04:00 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:477102</guid><dc:creator>chilberto</dc:creator><description>&lt;p&gt;To illustrate the &lt;a href="http://www.codeplex.com/WCFTestHarness"&gt;WCF Test Harness&lt;/a&gt;, I create a service contract with a variety of operations defined.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto.WCFTestHarness/ICustomerService.bmp"&gt;&lt;img border="0" src="http://bloggingabout.net/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto.WCFTestHarness/ICustomerService.bmp" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Also a service host was created to host the contract at &lt;a href="http://localhost:9991/CustomerService"&gt;http://localhost:9991/CustomerService&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_4.png"&gt;&lt;/a&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto.WCFTestHarness/TestHost.bmp"&gt;&lt;img border="0" src="http://bloggingabout.net/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto.WCFTestHarness/TestHost.bmp" alt="" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://bloggingabout.net/blogs/chilberto/pages/wcf-test-harness-overview.aspx"&gt;Overview&lt;/a&gt;&lt;/p&gt;</description></item><item><title>WCF Test Harness Guide updated</title><link>http://bloggingabout.net/blogs/chilberto/archive/2008/11/16/wcf-test-harness-guide-updated.aspx</link><pubDate>Sun, 16 Nov 2008 21:06:17 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:477023</guid><dc:creator>chilberto</dc:creator><description>&lt;p&gt;I&amp;#39;ve added a new page to the Guide: &lt;a href="http://bloggingabout.net/blogs/chilberto/pages/wcf-test-harness-adding-a-new-proxy-via-assembly.aspx"&gt;Adding a New Proxy via Assembly&lt;/a&gt;.&amp;nbsp; &lt;/p&gt;</description></item><item><title>WCF Test Harness: Adding a new Proxy via Assembly</title><link>http://bloggingabout.net/blogs/chilberto/archive/2008/11/15/wcf-test-harness-adding-a-new-proxy-via-assembly.aspx</link><pubDate>Sat, 15 Nov 2008 22:48:00 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:477020</guid><dc:creator>chilberto</dc:creator><description>&lt;p&gt;The following steps will create a new Proxy by referencing an already defined client proxy:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;To illustrate referencing an already compiled client proxy, I first build a client proxy for the Sample Host included in the download.&amp;nbsp; Launch the sample host by double-clicking the Spike.TestHost.exe located in the TestHost folder:&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_32.png"&gt;&lt;img border="0" width="362" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_thumb_5F00_15.png" alt="image" height="120" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Next create a new project in Visual Studio for the class library:&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_2.png"&gt;&lt;/a&gt;&amp;nbsp;&lt;img width="686" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto.WCFTestHarness/NewProjectSampleClient.bmp" alt="New Project" height="506" /&gt;&lt;/li&gt;
&lt;li&gt;Then select Add Service Reference...&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_6.png"&gt;&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;img width="225" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto.WCFTestHarness/AddServiceReference.bmp" alt="Add Service Reference" height="92" /&gt;&lt;/li&gt;
&lt;li&gt;Next enter the URL for the metadata enabled endpoint:&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_8.png"&gt;&lt;/a&gt;&lt;img width="530" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto.WCFTestHarness/AddServiceReferenceDlg.bmp" alt="Add Service Reference" height="216" /&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Build the project and copy the assembly to the &lt;em&gt;ClientAssemblies&lt;/em&gt; folder of the Test Harness&lt;br /&gt;(Note: in Versions earlier than 1.0.1.0, do not copy the .pdb as this will cause all assemblies to fail to load)&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto.WCFTestHarness/ClientAssemblies.bmp"&gt;&lt;img border="0" src="http://bloggingabout.net/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto.WCFTestHarness/ClientAssemblies.bmp" alt="" /&gt;&lt;/a&gt;&amp;nbsp;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_30.png"&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Next copy the &lt;em&gt;SampleClient.dll.config&lt;/em&gt; file:&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_10.png"&gt;&lt;/a&gt;&amp;nbsp;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto.WCFTestHarness/ClientConfiguration.bmp"&gt;&lt;img border="0" src="http://bloggingabout.net/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto.WCFTestHarness/ClientConfiguration.bmp" alt="" /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;This should be placed in the &lt;em&gt;ClientConfiguration&lt;/em&gt; sub-folder of the Test Harness&lt;br /&gt;(Note: in Versions earlier than 1.0.1.0, you will need to create the &lt;em&gt;ClientConfiguration&lt;/em&gt; sub-folder first)&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_16.png"&gt;&lt;img border="0" width="297" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_thumb_5F00_7.png" alt="image" height="114" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Now that the client has been copied, we are ready to create a new Test Case.&amp;nbsp; The following are identical steps to those described in &lt;a href="http://bloggingabout.net/blogs/chilberto/pages/wcf-test-harness-createing-a-new-test-case.aspx"&gt;Creating a New Test Case&lt;/a&gt; and are included here to complete this scenario only &lt;/li&gt;
&lt;li&gt;After launching the Test Harness, select New Test Case menu item from the File menu:&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_18.png"&gt;&lt;img border="0" width="211" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_thumb_5F00_8.png" alt="image" height="155" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Provide a unique name to describe the Test Case and select the SampleClient.dll as the contract name:&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_20.png"&gt;&lt;img border="0" width="323" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_thumb_5F00_9.png" alt="image" height="181" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Change the name in the message payload to Sally:&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_26.png"&gt;&lt;img border="0" width="233" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_thumb_5F00_12.png" alt="image" height="79" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Now, click the Execute Single button:&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_22.png"&gt;&lt;img border="0" width="112" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_thumb_5F00_10.png" alt="image" height="40" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;The test case should complete with a 0 being returned:&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_24.png"&gt;&lt;img border="0" width="244" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_thumb_5F00_11.png" alt="image" height="63" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;And the sample host should indicate a message containing customer Sally was received:&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_28.png"&gt;&lt;img border="0" width="244" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_thumb_5F00_13.png" alt="image" height="52" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href="http://bloggingabout.net/blogs/chilberto/pages/wcf-test-harness-overview.aspx"&gt;Overview&lt;/a&gt;&lt;/p&gt;</description></item><item><title>First CodePlex Project: WCF Test Harness</title><link>http://bloggingabout.net/blogs/chilberto/archive/2008/11/14/first-codeplex-project-wcf-test-harness.aspx</link><pubDate>Fri, 14 Nov 2008 02:26:48 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:476925</guid><dc:creator>chilberto</dc:creator><description>&lt;p&gt;I&amp;#39;ve just published my first CodePlex project: &lt;a href="http://www.codeplex.com/WCFTestHarness" target="_blank"&gt;WCF Test Harness&lt;/a&gt;.&amp;nbsp; This is a testing utility I have been working on for a while now and I thought it could be helpful for others.&lt;/p&gt; &lt;p&gt;I wrote a short &lt;a href="http://bloggingabout.net/blogs/chilberto/pages/wcf-test-harness-overview.aspx"&gt;Overview&lt;/a&gt; and I plan on adding additional information depending on interest.&lt;/p&gt;</description></item><item><title>WCF Test Harness: Adding a New Proxy via URL</title><link>http://bloggingabout.net/blogs/chilberto/archive/2008/11/11/wcf-test-harness-adding-a-new-proxy-via-url.aspx</link><pubDate>Tue, 11 Nov 2008 19:41:00 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:476910</guid><dc:creator>chilberto</dc:creator><description>&lt;p&gt;The following steps will create a new Proxy by retrieving the metadata from a specified URL:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Launch the sample host by double-clicking Spike.TestHost.exe located in the TestHost folder&lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto.WCFTestHarness/TestHost.bmp"&gt;&lt;img border="0" width="331" src="http://bloggingabout.net/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto.WCFTestHarness/TestHost.bmp" height="172" alt="" /&gt;&lt;/a&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_4.png"&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Launch test harness by double-clicking Spike.TestHarness.exe.&amp;nbsp; Select the Add via URL menu item on the Client menu:&lt;br /&gt;&lt;img width="229" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto.WCFTestHarness/AddViaUrl.bmp" alt="Add Via Url" height="86" /&gt;&lt;/li&gt;
&lt;li&gt;Enter a unique name for the new proxy and enter the services URL (Note: the name of the proxy must be unique within the test harness and will correspond to the Test Case Contract):&lt;br /&gt;&lt;img src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto.WCFTestHarness/AddUrlDialog.bmp" alt="Add Url Dialog" /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/chilberto/image_5F00_6.png"&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;If the dialogue closes without error, then the proxy was generated successfully&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href="http://bloggingabout.net/blogs/chilberto/pages/wcf-test-harness-createing-a-new-test-case.aspx"&gt;Creating a New Test Case&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://bloggingabout.net/blogs/chilberto/pages/wcf-test-harness-overview.aspx"&gt;Overview&lt;/a&gt;&lt;/p&gt;</description></item></channel></rss>