<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.southworks.net/~d/styles/itemcontent.css"?><rss 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" version="2.0">

<channel>
	<title>Gabriel Szlechtman\'s Blog</title>
	
	<link>http://blogs.southworks.net/gabrielsz</link>
	<description>Breaking the build server</description>
	<pubDate>Wed, 24 Jun 2009 05:46:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.southworks.net/gabrielsz" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="gabrielsz" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Geneva Server Beta 2: Troubleshooting Windows Integrated Authentication</title>
		<link>http://blogs.southworks.net/gabrielsz/2009/06/24/geneva-server-beta-2-troubleshooting-windows-integrated-authentication/</link>
		<comments>http://blogs.southworks.net/gabrielsz/2009/06/24/geneva-server-beta-2-troubleshooting-windows-integrated-authentication/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 05:46:36 +0000</pubDate>
		<dc:creator />
		
		<category><![CDATA[IIS]]></category>

		<category><![CDATA[Identity]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/gabrielsz/2009/06/24/geneva-server-beta-2-troubleshooting-windows-integrated-authentication/</guid>
		<description><![CDATA[When in Geneva Server Beta 2 you try to configure and use Windows Integrated Authentication, it may not prompt for credentials and instead you receive an error message:

When connecting from another computer, you may see the following error message:&#160;       
And when you connect from the same server, the more [...]]]></description>
			<content:encoded><![CDATA[<p>When in <a href="https://connect.microsoft.com/site/sitehome.aspx?SiteID=642">Geneva Server</a> Beta 2 you try to configure and use Windows Integrated Authentication, it may not prompt for credentials and instead you receive an error message:</p>
<ul>
<li>When connecting from another computer, you may see the following error message:&#160; <br /><img border="0" alt="Access is denied due to invalid credentials" src="http://blogs.southworks.net/gabrielsz/files/2009/06/image4.png" width="640" height="149" />      </li>
<li>And when you connect from the same server, the more detailed error is displayed:     <br /><img border="0" alt="HTTP Error 401.2 - Unauthorized You are not authorized to view this page due to invalid authentication headers" src="http://blogs.southworks.net/gabrielsz/files/2009/06/image5.png" width="640" height="446" /> </li>
</ul>
<p>The error messages indicate that Windows Authentication is disabled, but when you check the IIS configuration it shows as if it were enabled:   <br /><img border="0" alt="image" src="http://blogs.southworks.net/gabrielsz/files/2009/06/image6.png" width="464" height="199" /> </p>
<h2>So, where is the error?</h2>
<p>In IIS 7 the overall configuration file is stored in <strong>C:\Windows\System32\inetsrv\config\<a href="http://learn.iis.net/page.aspx/124/introduction-to-applicationhostconfig/">applicationHost.config</a></strong>. The file contains some <a href="http://learn.iis.net/page.aspx/157/how-to-use-configuration-delegation-in-iis-70/">configurations</a> that apply to the whole server, some configurations that apply to each site, and some that apply to a specific path. If you scroll down the file until you see the &quot;FederationPassive&quot; location configuration, you&#8217;ll see that Windows Authentication is disabled. That is OK except that it is also removing the authentication providers, so no child location can use Windows Authentication without them!</p>
<p>&#160;<img border="0" alt="image" src="http://blogs.southworks.net/gabrielsz/files/2009/06/image7.png" width="486" height="229" /> </p>
<h2>Solution</h2>
<p>Open <strong>applicationHost.config</strong> in a text editor. Find the <strong>&lt;location&gt;</strong> tag related to Windows Integrated Authentication and modify it to look like the following:</p>
<p><img border="0" alt="image" src="http://blogs.southworks.net/gabrielsz/files/2009/06/image8.png" width="838" height="209" /> </p>
<h3>Configuration section</h3>
<p>Below you&#8217;ll find the complete configuration section that you can copy and paste onto your <strong>applicationHost.config</strong> file.</p>
<p><font face="Consolas">&lt;location path=&quot;Default Web Site/FederationPassive/auth/integrated&quot; &gt;     <br />&#160;&#160;&#160; &lt;system.webServer&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;security&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;authentication&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;anonymousAuthentication enabled=&quot;false&quot; /&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;windowsAuthentication enabled=&quot;true&quot;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font face="Consolas">useKernelMode=&quot;true&quot; useAppPoolCredentials=&quot;true&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;providers&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;add value=&quot;Negotiate&quot; /&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;add value=&quot;NTLM&quot; /&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/providers&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/windowsAuthentication&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/authentication&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/security&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;handlers accessPolicy=&quot;Read, Script&quot; /&gt;      <br />&#160;&#160;&#160; &lt;/system.webServer&gt;      <br />&lt;/location&gt;</font></p>
<p>When you save the file, IIS will automatically reload the configuration, so you don&#8217;t need to restart any service.</p>
<p>Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/gabrielsz/2009/06/24/geneva-server-beta-2-troubleshooting-windows-integrated-authentication/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Visual Studio Load Testing: Optimizing Performance Lab Time</title>
		<link>http://blogs.southworks.net/gabrielsz/2009/06/04/visual-studio-load-testing-optimizing-performance-lab-time/</link>
		<comments>http://blogs.southworks.net/gabrielsz/2009/06/04/visual-studio-load-testing-optimizing-performance-lab-time/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 20:00:35 +0000</pubDate>
		<dc:creator />
		
		<category><![CDATA[Load Testing]]></category>

		<category><![CDATA[Performance Testing]]></category>

		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/gabrielsz/2009/06/04/visual-studio-load-testing-optimizing-performance-lab-time/</guid>
		<description><![CDATA[When modeling a Web Application&#8217;s responsiveness with an increasing User Load, you usually configure a Load Test Mix with a Step based Load Pattern, run the test until the Response Time goes above a certain response time, and then manually stop the test. This requires some of your time monitoring the test progress and having [...]]]></description>
			<content:encoded><![CDATA[<p>When modeling a Web Application&#8217;s responsiveness with an increasing User Load, you usually configure a Load Test Mix with a Step based Load Pattern, run the test until the Response Time goes above a certain response time, and then manually stop the test. This requires some of your time monitoring the test progress and having to intervene to stop the test.</p>
<p> <img src="http://blogs.southworks.net/gabrielsz/files/2009/06/image.png" border="0" alt="image" width="640" height="340" /></p>
<p>Wouldn&#8217;t be nice if this was automated? Fortunately this can be easily achieved through the use of a custom Load Test Plugin (ILoadTestPlugin) and a configured Threshold. (Custom load test plugins were improved in VS2008SP1 and are also available in VS 2010, used in the creation of this blog post.) This will save you (the Tester) the trouble of having to manually monitor the load test and stop it when the threshold is exceeded.<br />
<img src="http://blogs.southworks.net/gabrielsz/files/2009/06/image1.png" border="0" alt="image" width="640" height="106" /></p>
<p>Let&#8217;s take a look at how this can be implemented in code:</p>
<h2>Creating a Load Test Plug-in that stops the Load Test when a threshold is exceeded</h2>
<p>Load Test Plug-ins allow custom code to be executed when a load test starts, ends, or when a threshold was exceeded, among other events. We&#8217;ll create a Custom Load Test Plug-in that attaches itself to the <strong>ThresholdExceeded</strong> event and stops the test.</p>
<ol>
<li>Create a Class Library project.</li>
<li>Add a reference to the <strong>Microsoft.VisualStudio.QualityTools.LoadTestFramework</strong> assembly.</li>
<li>Create a class named <strong>CustomLoadTestPlugin</strong> and complete it with the following code (VS2008 and VS2010):
<p><!-- begin code paste --></p>
<p class="MsoNormal">
<pre><span style="color: blue">using </span>System;
<span style="color: blue">using </span>Microsoft.VisualStudio.TestTools.LoadTesting;

<span style="color: blue">public class </span><span style="color: #2b91af">CustomLoadTestPlugin </span>: ILoadTestPlugin
{
    <span style="color: blue">private </span>LoadTest test;

    <span style="color: blue">public void </span>Initialize(LoadTest loadTest)
    {
        <span style="color: blue">if </span>(loadTest == <span style="color: blue">null</span>)
        {
            <span style="color: blue">throw new </span><span style="color: #2b91af">ArgumentNullException</span>(<span style="color: #a31515">&quot;loadTest&quot;</span>);
        }

        <span style="color: blue">this</span>.test = loadTest;

        loadTest.ThresholdExceeded += <span style="color: blue">new </span><span style="color: #2b91af">EventHandler</span>&lt;ThresholdExceededEventArgs&gt;(OnThresholdExceeded);
    }

    <span style="color: blue">void </span>OnThresholdExceeded(<span style="color: blue">object </span>sender, ThresholdExceededEventArgs e)
    {
        <span style="color: blue">if </span>(e.ThresholdResult == ThresholdRuleResult.Critical
            &amp;&amp; e.CounterValue != <span style="color: blue">null
            </span>&amp;&amp; e.CounterValue.CounterName == <span style="color: #a31515">&quot;Avg. Test Time&quot;</span>)
        {
            <span style="color: blue">this</span>.test.Scenarios[0].CurrentLoad = 0;
            <span style="color: blue">this</span>.test.Abort();
        }
    }
}</pre>
<p><!-- end code paste -->
</li>
<li>Build the Load Test Plug-in solution</li>
</ol>
<p><em>Note: If you&#8217;d like to get more information about creating a Load Test Plug-in, see the following </em><a href="http://msdn.microsoft.com/en-us/library/ms243153.aspx"><em>link</em></a><em>.</em></p>
<h2>Using the Custom Load Test Plug-in</h2>
<ol>
<li>Open the Load Test Configuration (.loadtest) you&#8217;d like to modify.</li>
<li>Using Solution Explorer, add a reference to the Load Test Plug-In (either to the Load Test Plug-In project or to the compiled assembly).</li>
<li>Add a Compare Constant threshold rule on the Avg. Test Time counter. To do this, Expand the <strong>Counter Sets</strong> | <strong>LoadTest</strong> | <strong>Counter Categories</strong> | <strong>LoadTest:Test</strong> element, right click on the <strong>Avg. Test Time</strong> counter and select <strong>Add Threshold Rule</strong>.<img src="http://blogs.southworks.net/gabrielsz/files/2009/06/image2.png" border="0" alt="image" width="395" height="459" /></li>
<li>Add the Load Test Plug-In to the test run. To do this, right click on the Load Test Name (the top element) and choose Add Load Test Plug-in. On the window that opens, select CustomLoadTestPlugin and hit OK.
<p><img src="http://blogs.southworks.net/gabrielsz/files/2009/06/image3.png" border="0" alt="image" width="192" height="103" /></li>
<li>That&#8217;s it, you should now run the Load Test and see if it stops after your configured threshold.</li>
</ol>
<p>Hope this saves you time. If you&#8217;d like to learn more ways to extend Visual Studio Load Testing, check <a href="http://blogs.msdn.com/billbar/">Bill Barnett&#8217;s</a>  <a href="http://blogs.msdn.com/billbar/articles/533216.aspx">article</a>.</p>
<h2>Related Articles</h2>
<ul>
<li><a title="Permanent Link to Visual Studio 2010- How to create a Performance Data Collector" href="http://blogs.southworks.net/gabrielsz/2009/05/21/visual-studio-2010-how-to-create-a-performance-data-collector/">Visual Studio 2010- How to create a Performance Data Collector</a></li>
</ul>
<p>Happy testing!</p>
<div id="39136f40-7337-440e-afbb-e5e3f4fafdb6" class="wlWriterEditableSmartContent" style="padding-bottom: 0px;margin: 0px;padding-left: 0px;padding-right: 0px;float: none;padding-top: 0px">Technorati Tags: <a rel="tag" href="http://technorati.com/tags/Load+Testing">Load Testing</a>,<a rel="tag" href="http://technorati.com/tags/Performance+Testing">Performance Testing</a>,<a rel="tag" href="http://technorati.com/tags/Visual+Studio">Visual Studio</a></div>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fblogs.southworks.net%2fgabrielsz%2f2009%2f06%2f04%2fvisual-studio-load-testing-optimizing-performance-lab-time%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fblogs.southworks.net%2fgabrielsz%2f2009%2f06%2f04%2fvisual-studio-load-testing-optimizing-performance-lab-time%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/gabrielsz/2009/06/04/visual-studio-load-testing-optimizing-performance-lab-time/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Visual Studio 2010: How to create a Performance Data Collector</title>
		<link>http://blogs.southworks.net/gabrielsz/2009/05/21/visual-studio-2010-how-to-create-a-performance-data-collector/</link>
		<comments>http://blogs.southworks.net/gabrielsz/2009/05/21/visual-studio-2010-how-to-create-a-performance-data-collector/#comments</comments>
		<pubDate>Thu, 21 May 2009 14:39:19 +0000</pubDate>
		<dc:creator />
		
		<category><![CDATA[Data Collector]]></category>

		<category><![CDATA[Performance Collector]]></category>

		<category><![CDATA[Performance Testing]]></category>

		<category><![CDATA[Visual Studio 2010]]></category>

		<category><![CDATA[Visual Studio 2010 Beta 1]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/gabrielsz/2009/05/21/visual-studio-2010-how-to-create-a-performance-data-collector/</guid>
		<description><![CDATA[Let&#8217;s assume you often run Performance Tests and your application outputs a log file that you manually backup on every test run. You can automate the process using a Collector, a new feature that ships with Visual Studio 2010.
Note: For a great introduction on Data Collectors in Visual Studio 2010 Beta1, please check Amit&#8217;s blog.
This [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s assume you often run Performance Tests and your application outputs a log file that you manually backup on every test run. You can automate the process using a Collector, a new feature that ships with Visual Studio 2010.</p>
<p><strong>Note: </strong>For a great introduction on Data Collectors in Visual Studio 2010 Beta1, please check <a href="http://blogs.msdn.com/amit_chatterjee/archive/2009/03/28/remote-execution-and-data-collection.aspx">Amit&#8217;s blog</a>.</p>
<p>This post is meant to answer the question: <em>How can I create my own Data Collector in Visual Studio 2010? </em></p>
<h1>Steps to create a Performance Collector</h1>
<p>Let&#8217;s create a Performance Collector that generates a log file and copies it to the Test Results folder:</p>
<ol>
<li>Create a Class Library Project (C# 4.0).</li>
<li>Add a reference to <strong>Microsoft.VisualStudio.PerformanceTools.DataCollection</strong> and <strong>Microsoft.VisualStudio.QualityTools.ExecutionCommon</strong>. Both assemblies can be found in the %DevEnvDir%\PrivateAssemblies folder, and should only be used for extending Visual Studio.<br />
<img src="http://blogs.southworks.net/gabrielsz/files/2009/05/image.png" border="0" alt="image" width="460" height="134" /></li>
<li>Create a new class. Assign it a name, like CustomLogDataCollector.</li>
<li>Add the following using declarations above the class name.<br />
<img src="http://blogs.southworks.net/gabrielsz/files/2009/05/image1.png" border="0" alt="image" width="457" height="78" /></li>
<li>Make the class inherit from <strong>DataCollector</strong> (<strong>Microsoft.VisualStudio.PerformanceTools.DataCollection</strong> namespace).</li>
<li>Decorate the class name with the <strong>DataCollectorFriendlyName</strong>, <strong>DataCollectorTypeUri</strong> and <strong>DataCollectorDescription</strong> attributes. The Uri needs to be unique for Visual Studio to identify the Collector, it is usually created in a Company/CollectorName/Version hierarchy, as shown below.<br />
<a href="http://blogs.southworks.net/gabrielsz/files/2009/05/image2.png"><img src="http://blogs.southworks.net/gabrielsz/files/2009/05/image-thumb.png" border="0" alt="image" width="473" height="78" /></a></li>
<li>Add a property of type <strong>IDataCollectorSink</strong> and implement the <strong>DoInitialize </strong>method to capture the <strong>IDataCollectorSink</strong> value. An <strong>IDataCollectorSink</strong> allows the Collector to interact with the Test Results folder.<br />
<img src="http://blogs.southworks.net/gabrielsz/files/2009/05/image3.png" border="0" alt="image" width="588" height="159" /></li>
<li>Override the <strong>SessionEnd</strong> method and invoke the IDataCollectionSync&#8217;s <strong>SendFileAsync</strong> method to copy the log file contents into the Test Results folder. In the example below I&#8217;m simulating a log file by creating a HelloWorld.txt file with a log line. It&#8217;s very easy to adapt this to your own environment!<br />
 <img src="http://blogs.southworks.net/gabrielsz/files/2009/05/image4.png" border="0" alt="image" width="495" height="193" /></li>
<li>Build the project. Copy the project&#8217;s DLL into the %DevEnvDir%\PrivateAssemblies\DataCollectors folder.</li>
</ol>
<p>That&#8217;s it! Now it&#8217;s time to enjoy your first Custom Collector. </p>
<h2>Using the custom Data Collector in your Test Project</h2>
<p>To use the Data Collector for your Test Project you just need to:</p>
<ol>
<li>In Solution Explorer, double click on the &#8220;.testsettings&#8221; file (the project&#8217;s test run configuration) to open the configuration editor.<br />
 <img src="http://blogs.southworks.net/gabrielsz/files/2009/05/image5.png" border="0" alt="image" width="248" height="148" /></li>
<li>Select the <strong>Execution Criteria</strong> configuration from the list on the left. In the Collectors section on the right, scroll down until you see &#8220;Your custom collector1&#8243;. Make sure the <strong>Enabled</strong> checkbox is selected and click <strong>Apply</strong> and then <strong>Close</strong>. <img src="http://blogs.southworks.net/gabrielsz/files/2009/05/image6.png" border="0" alt="image" width="767" height="662" /></li>
<li>Start a Load Test run.<br />
<img src="http://blogs.southworks.net/gabrielsz/files/2009/05/image7.png" border="0" alt="image" width="490" height="179" /></li>
<li>Wait until the Load Test run is completed. On the Test Results window, click the <strong>Test run completed</strong> link.<br />
<img src="http://blogs.southworks.net/gabrielsz/files/2009/05/image8.png" border="0" alt="image" width="519" height="202" /></li>
<li>Verify that there is a file named HelloWorld.txt in the <strong>Collected Files</strong> section, as shown below. Clicking the link will open the file in your configured text editor.<br />
<img src="http://blogs.southworks.net/gabrielsz/files/2009/05/image9.png" border="0" alt="image" width="570" height="272" /></li>
</ol>
<h2>Next steps</h2>
<p>This was a quick introduction on how to create custom Collectors for your Test Projects. Now that you have it working, you can augment it by creating:</p>
<ul>
<li>An installer that copies the DLL file to PrivateAssemblies\DataCollectors folder</li>
<li>A class to hold the Collector&#8217;s configuration</li>
<li>A visual editor for the Data Collector&#8217;s options</li>
</ul>
<p>I hope you can find a good use for this, and your feedback is greatly appreciated.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/gabrielsz/2009/05/21/visual-studio-2010-how-to-create-a-performance-data-collector/feed/</wfw:commentRss>
		</item>
		<item>
		<title>On the Semantic Web: SPARQL queries</title>
		<link>http://blogs.southworks.net/gabrielsz/2009/01/09/semantic-web-sparql-queries/</link>
		<comments>http://blogs.southworks.net/gabrielsz/2009/01/09/semantic-web-sparql-queries/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 13:15:02 +0000</pubDate>
		<dc:creator />
		
		<category><![CDATA[SemanticWeb]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/gabrielsz/?p=21</guid>
		<description><![CDATA[On my previous posts I wrote about what the Semantic Web is, and how to design your information to be stored on a Semantic Web system. Now it&#8217;s time to get the juice out of the data, by using the SPARQL query language, which was designed specifically for this purpose.
Thinking in triples
When doing SPARQL queries, [...]]]></description>
			<content:encoded><![CDATA[<p>On my <a href="http://blogs.southworks.net/gabrielsz/2008/12/18/semantic-web-intro/" target="_blank">previous</a> <a href="http://blogs.southworks.net/gabrielsz/2008/12/19/semantic-web-information/" target="_blank">posts</a> I wrote about <a href="http://blogs.southworks.net/gabrielsz/2008/12/18/semantic-web-intro/" target="_blank">what the Semantic Web is</a>, and <a href="http://blogs.southworks.net/gabrielsz/2008/12/19/semantic-web-information/" target="_blank">how to design your information</a> to be stored on a Semantic Web system. Now it&#8217;s time to get the juice out of the data, by using the <a href="http://www.w3.org/TR/rdf-sparql-query/" target="_blank">SPARQL query language</a>, which was designed specifically for this purpose.</p>
<h2>Thinking in triples</h2>
<p>When doing SPARQL queries, you need to think in triples. For example, if you&#8217;d like to query for all persons that have a pet whose name is &#8220;Duke&#8221;, you could write the following query.</p>
<p><img src="http://blogs.southworks.net/gabrielsz/files/2009/01/windowslivewriteronthesemanticwebsparqlqueries-b753image-3.png" border="0" alt="image" width="640" height="265" /></p>
<p>You may wonder what are the different parts of the SPARQL query, and how to write one query of our own. We&#8217;ll get to that later.</p>
<p>Triple patterns can be chained to each other, to form complex queries. In the first line of the example above, I&#8217;m saying &#8220;bring me the <em>Name</em> of a <em>person</em>&#8220;; when chained to the second pattern, I&#8217;m saying &#8220;The <em>person</em> &#8216;?person&#8217; should be the <em>owner</em> of a <em>pet</em>&#8221; (note: in this context the only usage of <em>custom:Owner</em> is the one I&#8217;m talking about, otherwise I&#8217;d have to specify that ?pet is of type <em>Pet</em>) so &#8220;Bring me the <em>name</em> of a <em>person</em> that is <em>owner</em> of a <em>pet</em>&#8220;. As you may have already guessed, when adding the third pattern, I&#8217;m saying &#8220;and also, the pet&#8217;s <em>name</em> should be &#8216;Duke&#8217;&#8221;.</p>
<p><strong>Note:</strong> To enhance the potential of triple patterns, SPARQL has the  <a href="http://www.w3.org/TR/rdf-sparql-query/#scopeFilters">FILTER</a>, <a href="http://www.w3.org/TR/rdf-sparql-query/#optionals">OPTIONAL</a> and <a href="http://www.w3.org/TR/rdf-sparql-query/#alternatives">UNION</a> keywords, to have a granular control on which triples are returned.</p>
<h2>Namespaces and Ontologies</h2>
<p><img src="http://blogs.southworks.net/gabrielsz/files/2009/01/windowslivewriteronthesemanticwebsparqlqueries-b753image-5.png" border="0" alt="image" width="640" height="396" /></p>
<p>Even if I haven&#8217;t written about ontologies yet, you can think of them as namespaces, that group similar concepts in a certain context. It is not the same to say &#8220;Ink&#8221; in a printer store than in a digital tablet concept. Also, certain assumptions or inferences apply just to one context; following the example, the printer ink wears out where the digital ink does not.</p>
<p>Generally, an ontology is related one to one with a namespace.</p>
<p><img src="http://blogs.southworks.net/gabrielsz/files/2009/01/windowslivewriteronthesemanticwebsparqlqueries-b753image-8.png" border="0" alt="image" width="640" height="227" /></p>
<p>Namespaces in SPARQL work as a shortcut to avoid typing in the full namespace of an element. It saves much time when typing custom:Name instead of http://mySite/MySchema/Name, and also it helps improve readability. In most Semantic Web Software (like <a href="http://blogs.msdn.com/imm/">IMM</a>), standard namespaces are automatically added by the engine to avoid repeating the prefixes.</p>
<h2>Query output</h2>
<p><img src="http://blogs.southworks.net/gabrielsz/files/2009/01/windowslivewriteronthesemanticwebsparqlqueries-b753image-11.png" border="0" alt="image" width="640" height="290" /></p>
<p>On the query above, the &#8220;output columns&#8221; is a comma-separated list of values that are returned as columns. All of the SELECT variables must appear on the WHERE part, but the opposite is not true: there is no need to list every WHERE variable on the SELECT part.</p>
<p><strong>Note:</strong> In SPARQL, there are 4 ways to perform queries: <a href="http://www.w3.org/TR/rdf-sparql-query/#select">SELECT</a>, <a href="http://www.w3.org/TR/rdf-sparql-query/#construct">CONSTRUCT</a>, <a href="http://www.w3.org/TR/rdf-sparql-query/#ask">ASK</a> and <a href="http://www.w3.org/TR/rdf-sparql-query/#describe">DESCRIBE</a>. SELECT is the most common for simple queries; it returns a table whose fields are the values obtained from matching (binding) the triple patterns in the WHERE part. CONSTRUCT and DESCRIBE return an RDF graph that is built from matching the triple patterns in the WHERE part; CONSTRUCT is conceptually similar to the views in relational database: DESCRIBE is used to retrieve additional details about the matched triples. Finally, ASK is for doing boolean queries and works very similar to the Exists function in relational databases.</p>
<h2>More information</h2>
<p>If you&#8217;d like to learn more about SPARQL and ontologies, the following links may come in handy:</p>
<ul>
<li><a href="http://jena.sourceforge.net/ARQ/Tutorial/">ARQ - SPARQL Tutorial</a></li>
<li><a href="http://www.dajobe.org/2005/04-sparql/">SPARQL quick reference</a></li>
<li><a href="http://www.w3.org/TR/rdf-sparql-query/">SPARQL Query Language for RDF (W3C reference)</a></li>
<li><a href="http://www.w3.org/TR/owl-ref/">OWL Web Ontology Language (W3C reference)</a></li>
<li><a href="http://blogs.msdn.com/imm/archive/2007/11/21/creating-and-extending-owl-ontologies-in-imm.aspx">Creating and extending OWL ontologies in IMM</a> (<a href="http://blogs.msdn.com/imm/archive/2007/11/26/creating-and-extending-owl-ontologies-in-imm-part-2-of-2.aspx">part 2</a>)</li>
</ul>
<p>For examples on advanced queries, you can visit the following sites:</p>
<ul>
<li><a href="http://blogs.msdn.com/imm/archive/2008/10/28/advanced-sparql-in-imm.aspx">Advanced SPARQL in IMM</a></li>
<li><a title="http://www.w3.org/TR/rdf-dawg-uc/" href="http://www.w3.org/TR/rdf-dawg-uc/">RDF Data Access Use Cases and Requirements (W3C working draft)</a> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/gabrielsz/2009/01/09/semantic-web-sparql-queries/feed/</wfw:commentRss>
		</item>
		<item>
		<title>On the Semantic Web: How is the information stored?</title>
		<link>http://blogs.southworks.net/gabrielsz/2008/12/19/semantic-web-information/</link>
		<comments>http://blogs.southworks.net/gabrielsz/2008/12/19/semantic-web-information/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 21:31:16 +0000</pubDate>
		<dc:creator />
		
		<category><![CDATA[SemanticWeb]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/gabrielsz/?p=14</guid>
		<description><![CDATA[On my previous article, I wrote about what the Semantic Web is without actually showing how the information is transmitted and stored. This article assumes that you are a technical savvy person, and you would like to know how to design your applications for the Semantic Web.
When you design a system in an Object Oriented [...]]]></description>
			<content:encoded><![CDATA[<p>On my <a href="http://blogs.southworks.net/gabrielsz/2008/12/18/semantic-web-intro/" target="_blank">previous article</a>, I wrote about what the <a href="http://en.wikipedia.org/wiki/Semantic_Web" target="_blank">Semantic Web</a> is without actually showing how the information is transmitted and stored. This article assumes that you are a technical savvy person, and you would like to know how to design your applications for the Semantic Web.</p>
<p>When you design a system in an Object Oriented way, you think in entities within a <a href="http://www.martinfowler.com/eaaCatalog/domainModel.html" target="_blank">domain model</a>. These <a href="http://en.wikipedia.org/wiki/Business_object_(computer_science)" target="_blank">business objects</a> are usually mapped to Database rows, which are stored in tables. These database tables have a rigid schema, which is very complicated to update and maintain.</p>
<p><img height="188" alt="image" src="http://blogs.southworks.net/gabrielsz/files/2008/12/windowslivewriteronthesemanticwebhowistheinformationstore-fef1image-3.png" width="640" /></p>
<p>What happens if I want to create a new version of the system, whose business entities have different information stored? I would have to create a migration script, which will make the database unavailable for a certain time, and for most large databases the downtime is large enough to make the migration unaffordable.</p>
<p><a href="http://en.wikipedia.org/wiki/Message_Oriented_Middleware" target="_blank">Message-oriented middleware</a> (MOM) databases have an interesting approach that tackles the issue. Each business object is part of a message that is exchanged between services. MOM databases store the entire message in one special field (column) within a data table (usually of XML type), allowing them to evolve the schema for their message entities and keep the DB schema (there is no DB downtime). Each entity is carefully designed to use simple data types and have an unique ID (to be uniquely identifiable). Having a standard representation helps easier the migration path when the business objects have their schema partially modified (an old application can just have their mapping information updated, and there is no need to update the DB schema).</p>
<h2>Designing Entities</h2>
<p>If you design the business data storage using a similar design as MOMs, your entities will look like the following:</p>
<p><a href="http://blogs.southworks.net/gabrielsz/files/2008/12/windowslivewriteronthesemanticwebhowistheinformationstore-fef1image-6.png"><img height="285" alt="image" src="http://blogs.southworks.net/gabrielsz/files/2008/12/windowslivewriteronthesemanticwebhowistheinformationstore-fef1image-thumb-1.png" width="640" border="0" /></a></p>
<ul>
<li>Every entity will have an unique identifier that will become their identity within the system (and probably with external systems) and will be of a type. </li>
<li>Every entity will have their data and relationships drawn as a directed graph </li>
<li>Every data will have their type information embedded (so a person&#8217;s photo can be interpreted as a bitmap) </li>
</ul>
<p>Following these principles will lead you to entities that are easy to represent and transmit in standard formats such as <a href="http://www.w3.org/RDF/" target="_blank">RDF</a> or plain XML. Designing entities with unique identifiers also help synchronizing information that is related to a single entity.</p>
<h2>Representing entities in RDF</h2>
<p>The Semantic Web standardizes the way each entity is transmitted (and imported/exported) from Semantic Web systems. The entity we described in the preceding section can be represented in RDF as:</p>
<p><img height="129" alt="image" src="http://blogs.southworks.net/gabrielsz/files/2008/12/windowslivewriteronthesemanticwebhowistheinformationstore-fef1image-7.png" width="640" border="0" /></p>
<p>Evidently, most RDF entities will be much more complex than this example yet the example is useful to note:</p>
<ul>
<li>The type information is implicit when using a custom namespace and Tag name </li>
<li>The unique identifier is standardized within RDF </li>
<li>Attributes and relationships are stored as child tags </li>
</ul>
<h2>What is the logic behind RDF?</h2>
<p>The sample entity is actually a collection of facts about the entity (representation). The facts are:</p>
<ul>
<li>Entity <strong>http://people/johnDoe </strong>is <strong>of type</strong>&#160;<strong>Person</strong> </li>
<li><strong>http://people/johnDoe</strong> has a <strong>Name</strong> of <strong>&quot;John Doe&quot;</strong> (string literal) </li>
</ul>
<p>Semantic Web applications combines these facts with logic to represent more complex queries (for example, querying the list of HumanBeings (synonym) should return John Doe in the results).</p>
<p><a href="http://blogs.southworks.net/gabrielsz/files/2008/12/windowslivewriteronthesemanticwebhowistheinformationstore-fef1image-9.png"><img height="299" alt="image" src="http://blogs.southworks.net/gabrielsz/files/2008/12/windowslivewriteronthesemanticwebhowistheinformationstore-fef1image-thumb-2.png" width="640" border="0" /></a></p>
<p>The directed graph and the collection of facts are different views of the same information. Every piece of information is stored as: [Entity] [Relationship] [Value], which is the same as [Subject] [Predicate] [Object]. This is also known as <a href="http://www.w3.org/TR/rdf-sparql-query/#sparqlTriplePatterns" target="_blank">triple pattern in SPARQL</a>.</p>
<p>In natural language, you could write [Orson Welles] [was born on] [May 6, 1915]. It is the same when relating 2 entities: [Orson Welles] [directed] [Citizen Kane] *. The entities don&#8217;t have to be of the same type (in this example I&#8217;m relating a Person to a Movie).</p>
<p><strong>(*)</strong> A better design would be to design [Citizen Kane] [was directed by] [Orson Welles], but let&#8217;s put this discussion off for now.</p>
<h2>Can&#8217;t I just design a database this way?</h2>
<p>Simplifying the model, you could have tables with the &quot;Subject&quot;, &quot;Predicate&quot; and &quot;Object&quot; columns. The first 2 columns could be unique identifiers (a relationship must also be identifiable) where the last column should be a special field that can store either a reference to another entity (URI), a literal value (string, date/time, decimal, etc.) or a blob.</p>
<p>For simple facts and queries this approach may work. It could even be the starting point for Semantic Web system. Things get more complicated when adding validations (you can&#8217;t have more than 1 birthday but you can have more than 1 name) or inferences that generate new information ( &quot;A isMotherOf B&quot; whenever &quot;B is child of A andAlso A is a woman&quot;). This is why Semantic Engines are built (they hide the complexity of storage and provide an interface to access the Semantic information).</p>
<p>Products like <a href="http://blogs.msdn.com/imm/" target="_blank">IMM</a> work with a backend database, and they use an intermediate component to encapsulate the process of retrieving and storing entities, and performing queries.</p>
<h2>What&#8217;s next?</h2>
<p>I&#8217;m planning to write an article about <a href="http://www.w3.org/TR/rdf-sparql-query/" target="_blank">SPARQL</a> (the Semantic Web querying language, standardized by the W3C) and <a href="http://www.w3.org/TR/owl-ref/" target="_blank">ontologies</a>, which give a context (and a meaning within the context) to the Semantic Web information, setting a common language.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/gabrielsz/2008/12/19/semantic-web-information/feed/</wfw:commentRss>
		</item>
		<item>
		<title>On the Semantic Web: An introduction</title>
		<link>http://blogs.southworks.net/gabrielsz/2008/12/18/semantic-web-intro/</link>
		<comments>http://blogs.southworks.net/gabrielsz/2008/12/18/semantic-web-intro/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 23:00:00 +0000</pubDate>
		<dc:creator />
		
		<category><![CDATA[SemanticWeb]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/gabrielsz/?p=9</guid>
		<description><![CDATA[Many people say that Web 3.0, the &#8220;Semantic Web&#8221;, is coming. But what is the Semantic Web all about?
In the beginning, Internet was created as a way to share information between people in different organizations, like universities and research centers. In the early 90&#8217;s the Internet became of public usage and grew exponentially, and so [...]]]></description>
			<content:encoded><![CDATA[<p>Many people say that Web 3.0, the &#8220;Semantic Web&#8221;, is coming. But what is the Semantic Web all about?</p>
<p>In the beginning, Internet was created as a way to share information between people in different organizations, like universities and research centers. In the early 90&#8217;s the Internet became of public usage and grew exponentially, and so grew the information shared by people. An automated way to process the always increasing amount of information was needed. Nowadays, it is not enough to only use a keyword-based Web Search Engine to find the information on the web. This is where the Semantic Web comes in.</p>
<p>The <a href="http://en.wikipedia.org/wiki/Semantic_Web">Semantic Web</a> represents the <a href="http://en.wikipedia.org/wiki/Semantic_Web_Stack">collection of standards</a> that were created to share information not only between humans but also between the machines. It starts by defining a common language (<a href="http://www.w3.org/TR/xml11" target="_blank">XML</a>) and representation for the shared data (<a href="http://www.w3.org/TR/rdf-syntax-grammar/" target="_blank">RDF</a>). But the Semantic Web requires more than a common language and representation.</p>
<p><img src="http://blogs.southworks.net/gabrielsz/files/2008/12/windowslivewriteronthesemanticwebintroduction-fc35image-7.png" border="0" alt="image" width="644" height="483" /></p>
<h2>Do computers &#8220;understand&#8221; RDF?</h2>
<p>In order for machines to be able to process the information, machines must not only be able to read the information but also to &#8220;understand&#8221; them. I&#8217;m referring not only to understanding that &#8220;&lt;sw:Developer&gt;&#8221; is an XML tag in a namespace, but also that Developer represents an entity within a context (Ontology).</p>
<p>In order to retrieve the information that is put in <a href="http://www.w3.org/TR/rdf-syntax-grammar/" target="_blank">RDF</a> (XML) under a specific Ontology (<a href="http://www.w3.org/TR/owl-ref/">OWL</a>), a query language is needed. That is why SPARQL was created, and also to provide basic inferences; for example, every &#8220;Developer&#8221; is an &#8220;Southy&#8221; (within the company context <img src='http://blogs.southworks.net/gabrielsz/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ), so you will probably want to query for &#8220;all Southies&#8221; instead of Developers. A programmer can then create <a href="http://www.w3.org/TR/rdf-sparql-query/" target="_blank">SPARQL queries</a> that the systems use to retrieve this interchangeable information.</p>
<p> </p>
<p><a href="http://blogs.southworks.net/gabrielsz/files/2008/12/windowslivewriteronthesemanticwebintroduction-fc35image-9.png"><img src="http://blogs.southworks.net/gabrielsz/files/2008/12/windowslivewriteronthesemanticwebintroduction-fc35image-thumb-3.png" border="0" alt="image" width="644" height="484" /></a></p>
<h2>Queries in the Semantic Web</h2>
<p>So how does a SPARQL query look like?</p>
<p>In the example below, I want to answer the following question &#8220;How can we choose 2 people that had worked together, both have a high English level and at least 1 has management skills?&#8221;</p>
<p class="MsoNormal"><span style="font-size: 10pt;color: #0000ff">PREFIX</span><span style="font-size: 10pt;color: #000000"> sw: &lt;<a href="http://southworks.net/core/testOntology">http://southworks.net/core/testOntology</a>&gt; </span></p>
<p class="MsoNormal"><span style="font-size: 10pt;color: #0000ff">SELECT</span><span style="font-size: 10pt;color: #000000"> </span><span style="font-size: 10pt;color: #ff0000">?x</span><span style="font-size: 10pt;color: #000000"> </span><span style="font-size: 10pt;color: #ff0000">?y </span></p>
<p><span style="font-size: 10pt;color: #0000ff">WHERE</span></p>
<div><span style="font-size: 10pt;color: #000000">{ </span></div>
<div><span style="font-size: 10pt;color: #000000"> </span></div>
<div><span style="font-size: 10pt;color: #000000"> </span></div>
<p><span style="font-size: 10pt;color: #000000"> </p>
<p></span></p>
<p class="MsoNormal" style="margin: 0in 0.9pt 0pt 17.6pt"><span style="font-size: 10pt;color: #000000">  </span><span style="font-size: 10pt;color: #ff0000">?x</span><span style="font-size: 10pt;color: #000000"> sw:workedWith </span><span style="font-size: 10pt;color: #ff0000">?y </span><span style="font-size: 10pt;color: #000000">; </span></p>
<p class="MsoNormal" style="margin: 0in 0.9pt 0pt 17.6pt"><span style="font-size: 10pt;color: #000000">     sw:hasMgmtSkills &#8220;</span><span style="font-size: 10pt;color: #2e8b57">true</span><span style="font-size: 10pt;color: #000000">&#8220;^^xsd:boolean; </span></p>
<p class="MsoNormal" style="margin: 0in 0.9pt 0pt 17.6pt"><span style="font-size: 10pt;color: #000000">     sw:englishLevel &#8220;high&#8221;. </span></p>
<p class="MsoNormal" style="margin: 0in 0.9pt 0pt 17.6pt"><span style="font-size: 10pt;color: #000000">  </span><span style="font-size: 10pt;color: #ff0000">?y</span><span style="font-size: 10pt;color: #000000"> sw:englishLevel &#8220;high&#8221;. </span></p>
<p class="MsoNormal" style="margin: 0in 0.9pt 0pt 17.6pt"><span style="font-size: 10pt;color: #000000">} </span></p>
<p>This is a complex query where I&#8217;m querying not only for facts but also information that is inferred from these facts.</p>
<p>Note: For an interesting example of Advanced SPARQL queries in IMM, please see <a title="http://blogs.msdn.com/imm/archive/2008/10/28/advanced-sparql-in-imm.aspx" href="http://blogs.msdn.com/imm/archive/2008/10/28/advanced-sparql-in-imm.aspx">http://blogs.msdn.com/imm/archive/2008/10/28/advanced-sparql-in-imm.aspx</a></p>
<h2>Evolving the Semantic Web</h2>
<p>There is no need to be too sceptic to see that humans still need to write the queries, and there is still no released commercial system that answer natural language questions which are translated to SPARQL queries (products like <a title="http://www.monrai.com/products/cypher" href="http://www.monrai.com/products/cypher">Cypher</a> are still in Beta). What will the future bring on this side may depend on the evolution of these standards and the evolution of massive parallel computing.</p>
<p>I&#8217;ve left out an important detail though, that the information made available is naively trusted. When these systems publish and consume the information on the Internet, there must be a way to prove that the information is true, and to establish a trust relationship with the publisher (as we humans do). So far there are no implementations of an actual trust network, but plans for a public network based on a <a href="http://en.wikipedia.org/wiki/Public_key_infrastructure">Public Key Infrastructure</a> may turn into pillars for the future Trusted Semantic Web.</p>
<h2>Next articles</h2>
<p>I&#8217;m planning to write specific articles on:</p>
<ul>
<li>Real world applications, like <a href="http://blogs.msdn.com/imm/" target="_blank">IMM</a></li>
<li>Semantic engine internals</li>
<li>SPARQL</li>
</ul>
<p>Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/gabrielsz/2008/12/18/semantic-web-intro/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Just Released: Visual Studio 2008 Training Kit</title>
		<link>http://blogs.southworks.net/gabrielsz/2007/11/19/just-released-visual-studio-2008-training-kit/</link>
		<comments>http://blogs.southworks.net/gabrielsz/2007/11/19/just-released-visual-studio-2008-training-kit/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 23:37:58 +0000</pubDate>
		<dc:creator />
		
		<category><![CDATA[CardSpace]]></category>

		<category><![CDATA[WCF]]></category>

		<category><![CDATA[WF]]></category>

		<guid isPermaLink="false">/blogs/gabrielsz/archive/2007/11/19/Just-Released_3A00_-Visual-Studio-2008-Training-Kit.aspx</guid>
		<description><![CDATA[During the last several months we&#8217;ve been helping David Aiken, James Conard and the rest of the DPE team to push forward to complete this project.
The project contains:

A set of 20+ labs that can be used to learn and practice several technologies such as WCF, WF, CardSpace, ASP.NET AJAX, VSTO (Word, Excel, Outlook and SharePoint), [...]]]></description>
			<content:encoded><![CDATA[<p>During the last several months we&#8217;ve been helping David Aiken, James Conard and the rest of the DPE team to push forward to complete this project.</p>
<p>The project contains:</p>
<ul>
<li>A set of 20+ labs that can be used to learn and practice several technologies such as WCF, WF, CardSpace, ASP.NET AJAX, VSTO (Word, Excel, Outlook and SharePoint), and SilverLight</li>
<li>A set of decks (30+) that shows the technology key concepts</li>
<li>14 demo scripts that were used to present the technologies to customers and the community</li>
</ul>
<p>All of the content can be easily navigated through HTML Web pages.</p>
<p> </p>
<p>We think this is a very important .NET learning material for the community, which Microsoft has made available for <a href="http://go.microsoft.com/?linkid=7602397">download</a>.</p>
<p>Don&#8217;t miss David&#8217;s <a href="http://blogs.msdn.com/daiken/archive/2007/11/19/visual-studio-2008-training-kit-now-available.aspx">original post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/gabrielsz/2007/11/19/just-released-visual-studio-2008-training-kit/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Workaround for flaw in Windows Server 2008 RC0 + .NET 3.5 JSON services</title>
		<link>http://blogs.southworks.net/gabrielsz/2007/11/07/workaround-for-flaw-in-windows-server-2008-rc0-net-35-json-services/</link>
		<comments>http://blogs.southworks.net/gabrielsz/2007/11/07/workaround-for-flaw-in-windows-server-2008-rc0-net-35-json-services/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 00:10:00 +0000</pubDate>
		<dc:creator />
		
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">/blogs/gabrielsz/archive/2007/11/06/Workaround-for-flaw-in-Windows-Server-2008-RC0-_2B00_-.NET-3.5-JSON-services.aspx</guid>
		<description><![CDATA[Problem:
In Windows Server 2008 RC0 + .NET 3.5, JSON services do not work. An exception message is returned. If  behavior is enabled, a &#8220;Method not found&#8221; exception is returned. 
Cause:
Windows Server 2008 RC0 has an incorrect version of the System.Runtime.Serialization.dll file. In that DLL, the DataContract class does not contain a GetIdForInitialization method (which [...]]]></description>
			<content:encoded><![CDATA[<h2>Problem:</h2>
<p>In <strong>Windows Server 2008 RC0 + .NET 3.5</strong>, JSON services do not work. An exception message is returned. If <strong></strong> behavior is enabled, a &ldquo;Method not found&rdquo; exception is returned. </p>
<h2>Cause:</h2>
<p>Windows Server 2008 RC0 has an<strong> incorrect version of the System.Runtime.Serialization.dll file</strong>. In that DLL, the DataContract class does not contain a GetIdForInitialization method (which is invoked form System.ServiceModel.Web). The Windows Vista version contains that method, as shown below: </p>
<p><a href="http://www.flickr.com/photos/18584749@N04/1892370142/" title="Intercambio de fotos"><img alt="BP0001_F01" border="0" height="63" src="http://farm3.static.flickr.com/2407/1892370142_85c70ede02_o.png" width="284" /></a> </p>
<h2>Workaround:</h2>
<p>Use the <strong>System.Runtime.Serialization.dll</strong> file from the Windows Vista version. </p>
<ul>
<li>Copy the file on the user&rsquo;s desktop<br /><a href="http://www.flickr.com/photos/18584749@N04/1892370170/" title="Intercambio de fotos"><img alt="BP0001_F02" border="0" height="129" src="http://farm3.static.flickr.com/2020/1892370170_165af9d98b_o.png" width="125" /></a></li>
<li>Open a Visual Studio 2008 Command Prompt as administrator<br /><a href="http://www.flickr.com/photos/18584749@N04/1892370188/" title="Intercambio de fotos"><img alt="BP0001_F03" border="0" height="37" src="http://farm3.static.flickr.com/2053/1892370188_dfba87a2c8_o.png" width="253" /></a></li>
<li>Go to the <strong>C:\Users\username\Desktop</strong> folder</li>
<li>Run <strong>gacutil /i System.Runtime.Serialization.dll /f</strong></li>
<li>Run <strong>iisreset</strong> (to ensure the runtime is unloaded)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/gabrielsz/2007/11/07/workaround-for-flaw-in-windows-server-2008-rc0-net-35-json-services/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Escaping string literals in XML (C#)</title>
		<link>http://blogs.southworks.net/gabrielsz/2007/09/06/escaping-string-literals-in-xml-c/</link>
		<comments>http://blogs.southworks.net/gabrielsz/2007/09/06/escaping-string-literals-in-xml-c/#comments</comments>
		<pubDate>Thu, 06 Sep 2007 00:33:14 +0000</pubDate>
		<dc:creator />
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">/blogs/gabrielsz/archive/2007/09/05/Escaping-string-literals-in-XML-_2800_C_23002900_.aspx</guid>
		<description><![CDATA[If you are creating XML documents or fragments from a String (for example, when using a template engine to create XML fragments), you may have wondered if there is a .NET method that escapes the string.
For those cases, this code snippet may come in handy:

string escaped = SecurityElement.Escape(&#8220;This  is being escaped!&#8221;);

You can obtain more [...]]]></description>
			<content:encoded><![CDATA[<p>If you are creating XML documents or fragments from a String (for example, when using a template engine to create XML fragments), you may have wondered if there is a .NET method that escapes the string.</p>
<p>For those cases, this code snippet may come in handy:</p>
<div>
<pre style="padding-right: 0px;padding-left: 0px;font-size: 8pt;padding-bottom: 0px;margin: 0em;width: 100%;color: black;padding-top: 0px;font-family: consolas, 'Courier New', courier, monospace"><span style="color: #0000ff">string</span> escaped = SecurityElement.Escape(<span style="color: #006080">&#8220;This  is being escaped!&#8221;</span>);</pre>
</div>
<p>You can obtain more information about this method in <a href="http://msdn2.microsoft.com/en-us/library/system.security.securityelement.escape(VS.80).aspx" target="_blank">this page</a>.</p>
<p> </p>
<p>Cheers!</p>
<p>Gabriel</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/gabrielsz/2007/09/06/escaping-string-literals-in-xml-c/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Windows Server 2008 (beta 3) Developer Training Kit released!</title>
		<link>http://blogs.southworks.net/gabrielsz/2007/07/18/windows-server-2008-beta-3-developer-training-kit-released/</link>
		<comments>http://blogs.southworks.net/gabrielsz/2007/07/18/windows-server-2008-beta-3-developer-training-kit-released/#comments</comments>
		<pubDate>Wed, 18 Jul 2007 19:01:00 +0000</pubDate>
		<dc:creator />
		
		<category><![CDATA[CardSpace]]></category>

		<category><![CDATA[Eventing]]></category>

		<category><![CDATA[IIS]]></category>

		<category><![CDATA[MMC]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[TxF]]></category>

		<category><![CDATA[WCF]]></category>

		<category><![CDATA[WF]]></category>

		<guid isPermaLink="false">/blogs/gabrielsz/archive/2007/07/18/Windows-Server-2008-_2800_beta-3_2900_-Developer-Training-Kit-released_2100_.aspx</guid>
		<description><![CDATA[Hi Folks!
This is a project I was involved in, helping DPE, so I&#39;m proud to announce that it was just released to the public.
This Developer Training Kit is composed of 7 labs:
Introduction to Windows Communication Foundation  
Integrating CardSpace into Web Sites  
Introduction to Windows Workflow Foundation  
Using Windows Eventing  
Extending Windows PowerShell and the Microsoft Management [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Folks!</p>
<p>This is a project I was involved in, helping DPE, so I&#39;m proud to announce that it was just released to the public.</p>
<p>This Developer Training Kit is composed of 7 labs:</p>
<li><strong>Introduction to Windows Communication Foundation</strong>  </li>
<li><strong>Integrating CardSpace into Web Sites</strong>  </li>
<li><strong>Introduction to Windows Workflow Foundation  <br /></strong></li>
<li><strong>Using Windows Eventing  </strong></li>
<li><strong>Extending Windows PowerShell and the Microsoft Management Console</strong>  </li>
<li><strong>Extending IIS 7.0 with Custom Handlers  </strong></li>
<li><strong>Using Transactional NTFS (TxF)  </strong></li>
<p>For more information, please read James&#39; original post: <a href="http://blogs.msdn.com/jamescon/archive/2007/07/17/just-released-windows-server-2008-developer-training-kit-beta-3.aspx">http://blogs.msdn.com/jamescon/archive/2007/07/17/just-released-windows-server-2008-developer-training-kit-beta-3.aspx</a></p>
<p>The download is available at: <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=B36EE81A-AFF5-4314-95D7-DAD3ACFA8094&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?FamilyId=B36EE81A-AFF5-4314-95D7-DAD3ACFA8094&amp;displaylang=en</a></p>
<p>Cheers!</p>
<p>Gabriel</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/gabrielsz/2007/07/18/windows-server-2008-beta-3-developer-training-kit-released/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
