<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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>Alik Levin's : WCF</title><link>http://blogs.msdn.com/alikl/archive/tags/WCF/default.aspx</link><description>Tags: WCF</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>How To Generate Unit Test Using WCF Load Test – Quick Steps</title><link>http://blogs.msdn.com/alikl/archive/2009/06/29/how-to-generate-unit-test-using-wcf-load-test-quick-steps.aspx</link><pubDate>Mon, 29 Jun 2009 09:13:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9808237</guid><dc:creator>alikl</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/alikl/comments/9808237.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=9808237</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=9808237</wfw:comment><description>&lt;table border="0" cellspacing="5" cellpadding="2" width="557"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="226"&gt;&amp;#160;&lt;a href="http://practicethis.com/" rel="external nofollow" target="_blank"&gt;&lt;img title="Alik Levin" border="0" alt="Alik Levin" src="http://blogs.microsoft.co.il/blogs/mcs/WindowsLiveWriter/d20b00ba5cce_FD44/image_5.png" width="50" height="50" /&gt;&lt;/a&gt;&amp;#160;&amp;#160;&amp;#160; This is quick summary of steps for creating WCF Unit Tests using &lt;a href="http://wcfloadtest.codeplex.com/"&gt;WCF Load Test&lt;/a&gt; available for free on Codeplex. This quick summary created based on the Lab materials that ship with the &lt;a href="http://wcfloadtest.codeplex.com/"&gt;tool&lt;/a&gt;.&lt;/td&gt;        &lt;td valign="top" width="314"&gt;         &lt;p&gt;&lt;strong&gt;Quick Resource Box&lt;/strong&gt;&lt;/p&gt;          &lt;ul&gt;           &lt;li&gt;&lt;a href="http://wcfloadtest.codeplex.com/"&gt;WCF Load Test&lt;/a&gt; &lt;/li&gt;         &lt;/ul&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td colspan="2"&gt;         &lt;h3&gt;Summary of steps&lt;/h3&gt;          &lt;ul&gt;           &lt;li&gt;&lt;strong&gt;Step 1. Configure message tracing in the app.config file on client side.&lt;/strong&gt; &lt;/li&gt;            &lt;li&gt;&lt;strong&gt;Step 2. Run WCF client to invoke the remote methods and generate trace file.&lt;/strong&gt; &lt;/li&gt;            &lt;li&gt;&lt;strong&gt;Step 3. Generate Unit test based on trace file.&lt;/strong&gt; &lt;/li&gt;         &lt;/ul&gt;          &lt;h3&gt;&lt;strong&gt;Step 1. Configure message tracing in the app.config file on client side. &lt;/strong&gt;&lt;/h3&gt;          &lt;ol&gt;           &lt;li&gt;Select the &lt;b&gt;Diagnostics&lt;/b&gt; folder. &lt;/li&gt;            &lt;li&gt;Under &lt;b&gt;Message Logging&lt;/b&gt; click &lt;b&gt;Enable Message Logging&lt;/b&gt;. &lt;/li&gt;            &lt;li&gt;Click &lt;b&gt;Log Level&lt;/b&gt; and check &lt;b&gt;Service messages&lt;/b&gt;. The other options can be unchecked. &lt;/li&gt;            &lt;li&gt;Click &lt;b&gt;ServiceModelMessageLoggingListener&lt;/b&gt; and change the file name to be “WCFClient.svclog”. &lt;/li&gt;            &lt;li&gt;Under the Message Logging folder enable &lt;b&gt;LogEntireMessage&lt;/b&gt;. &lt;/li&gt;            &lt;li&gt;Save the configuration file. &lt;/li&gt;         &lt;/ol&gt;          &lt;h3&gt;&lt;strong&gt;Step 2. Run WCF client to invoke the remote methods and generate trace file.&lt;/strong&gt;&lt;/h3&gt;          &lt;p&gt;Run your WCF client. Make sure WCFClient.svclog generated. This log file will be used in the next step to generate Unit Tests&lt;/p&gt;          &lt;h3&gt;&lt;strong&gt;Step 3. Generate Unit test based on trace file.&lt;/strong&gt;&lt;/h3&gt;          &lt;ul&gt;           &lt;li&gt;Create a new test project in Visual Studio. &lt;/li&gt;            &lt;li&gt;Add a reference to the following assemblies:              &lt;ul&gt;               &lt;li&gt;System.ServiceModel &lt;/li&gt;                &lt;li&gt;System.Runtime.Serialization (version 3.0.0.0) &lt;/li&gt;             &lt;/ul&gt;           &lt;/li&gt;            &lt;li&gt;In the directory containing the test project create a file called SampleConfig.xml with the following contents:&amp;#160; &lt;/li&gt;         &lt;/ul&gt;          &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #a31515"&gt;xml &lt;/span&gt;&lt;span style="color: red"&gt;version&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;'&lt;span style="color: blue"&gt;1.0&lt;/span&gt;' &lt;span style="color: red"&gt;encoding&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;'&lt;span style="color: blue"&gt;utf-8&lt;/span&gt;' &lt;span style="color: blue"&gt;?&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;WcfUnitConfiguration &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;'&lt;span style="color: blue"&gt;http://microsoft.com/wcfunit&lt;/span&gt;'
                           &lt;span style="color: red"&gt;testMethodMode&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;'&lt;span style="color: blue"&gt;ScenarioMethodOnly&lt;/span&gt;'
                           &lt;span style="color: red"&gt;operationTimerMode&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;'&lt;span style="color: blue"&gt;IncludeOperationTimers&lt;/span&gt;'&lt;span style="color: blue"&gt;&amp;gt;
       &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;assembly &lt;/span&gt;&lt;span style="color: red"&gt;fileName&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;C:\Client\bin\Debug\ConsoleClient.exe&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
     &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;soapActions &lt;/span&gt;&lt;span style="color: red"&gt;soapActionMode&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;'&lt;span style="color: blue"&gt;Include&lt;/span&gt;'&lt;span style="color: blue"&gt;&amp;gt;
     &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;soapActions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;WcfUnitConfiguration&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
        &lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

        &lt;ul&gt;
          &lt;li&gt;Open an SDK command prompt and change the directory to the one containing the test project. &lt;/li&gt;

          &lt;li&gt;Execute the following command: 
            &lt;br /&gt;&lt;em&gt;svcutil /o:proxy.cs /config:app.config http://localhost:8090/service?wsdl &lt;/em&gt;&lt;/li&gt;

          &lt;li&gt;Run the command-line tool using the following command: 
            &lt;br /&gt;“c:\program files\wcfunit\wcfunit” CompileTimeScenario &amp;lt;trace file&amp;gt; SampleConfig.xml where the &amp;lt;trace file&amp;gt; is the path to the WCFClient.svclog file created in the previous exercise. &lt;/li&gt;

          &lt;li&gt;Add generated files (CompileTimeScenario.cs and CompileTimeScenario.stubs) to the test project. &lt;/li&gt;

          &lt;li&gt;Rename CompileTimeScenario.stubs to CompileTimeScenario.Stubs.cs. &lt;/li&gt;

          &lt;li&gt;Also add the proxy.cs and app.config files located in the client project folder to the test project. &lt;/li&gt;

          &lt;li&gt;Build the solution and a Unit Test called CompileTimeScenario should appear in the Test View. &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9808237" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Test+Phase/default.aspx">Test Phase</category></item><item><title>patterns &amp; practices Improving Web Services Security: Scenarios and Implementation Guidance for WCF - BETA Is Out</title><link>http://blogs.msdn.com/alikl/archive/2008/06/05/patterns-practices-improving-web-services-security-scenarios-and-implementation-guidance-for-wcf-beta-is-out.aspx</link><pubDate>Thu, 05 Jun 2008 06:57:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8574534</guid><dc:creator>alikl</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/alikl/comments/8574534.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=8574534</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=8574534</wfw:comment><description>&lt;p&gt;patterns &amp;amp; practices team has just released a beta version of WCF Security Guide on Codeplex. Download the guide at &lt;a href="http://www.codeplex.com/WCFSecurityGuide" target="_blank"&gt;http://www.codeplex.com/WCFSecurityGuide&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="179" alt="clip_image001" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/patternspracticesImprovingWebServicesSec_613A/clip_image001_3.jpg" width="143" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;Original announcement by J.D. Meier, the man behind the effort, is here - &lt;a href="http://blogs.msdn.com/jmeier/archive/2008/06/04/new-release-patterns-practices-wcf-security-guide-beta.aspx" target="_blank"&gt;New Release: patterns &amp;amp; practices WCF Security Guide (BETA)&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8574534" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Practices/default.aspx">Practices</category></item><item><title>WCF Security - Input/Data Validation Using Schemas</title><link>http://blogs.msdn.com/alikl/archive/2008/05/25/wcf-security-input-data-validation-using-schemas.aspx</link><pubDate>Sun, 25 May 2008 17:52:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8551021</guid><dc:creator>alikl</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/alikl/comments/8551021.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=8551021</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=8551021</wfw:comment><description>&lt;p&gt;WCF offers very flexible approach of Input and Data Validation based on XML Schemas. The approach is flexible since the validation rules are expressed in form of XML schema and can be changed at any time without recompiling the solution.&lt;/p&gt;  &lt;p&gt;I followed the steps detailed in &lt;a href="http://www.codeplex.com/WCFSecurity/Wiki/View.aspx?title=How%20To%20-%20Perform%20Message%20Validation%20with%20Schemas%20in%20WCF&amp;amp;referringTitle=How%20Tos" target="_blank"&gt;How To: Perform Message Validation with Schema Validation in WCF&lt;/a&gt; and ended up with another working sample (imagine that!).&lt;/p&gt;  &lt;p&gt;It took me a bit to struggle with the schema thing and then &lt;a href="http://msdn.microsoft.com/en-us/library/ms788993.aspx" target="_blank"&gt;enabling debugging&lt;/a&gt; info on the service side (remember, WCF is secure by default) to understand what's going on and why it fails time after time.&lt;/p&gt;  &lt;p&gt;In the end me and WCF made friends and I'd thought it'd be good to share with you the Visual Studio project. Download it &lt;a href="http://cid-dd25b83e4ca261f7.skydrive.live.com/self.aspx/Visual%20Studio%20Projects/WCFInputValidationSchema.zip" target="_blank"&gt;here&lt;/a&gt; from my SkyDrive and save yourself some time. &lt;/p&gt;  &lt;p&gt;&lt;iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 66px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-dd25b83e4ca261f7.skydrive.live.com/embedrowdetail.aspx/Visual%20Studio%20Projects/WCFInputValidationSchema.zip" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;  &lt;h3&gt;My related posts&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2008/05/25/wcf-security-input-data-validation-sample-visual-studio-project.aspx"&gt;WCF Security - Input/Data Validation Sample Visual Studio Project&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Enjoy.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8551021" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Input+Validation/default.aspx">Input Validation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Development+Phase/default.aspx">Development Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category></item><item><title>WCF Security - Input/Data Validation Sample Visual Studio Project</title><link>http://blogs.msdn.com/alikl/archive/2008/05/25/wcf-security-input-data-validation-sample-visual-studio-project.aspx</link><pubDate>Sun, 25 May 2008 14:17:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8550886</guid><dc:creator>alikl</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/alikl/comments/8550886.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=8550886</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=8550886</wfw:comment><description>&lt;p&gt;Input and Data Validation is one of the &lt;a href="http://shapingsoftware.com/2008/04/07/security-frame/" target="_blank"&gt;core security principles&lt;/a&gt;. &lt;a href="http://blogs.msdn.com/alikl/archive/2007/03/04/how-to-hack-wcf-new-technology-old-hacking-tricks.aspx" target="_blank"&gt;WCF is no exception&lt;/a&gt;. To get most out of WCF in secure way one must implement proper Input and Data Validation.&lt;/p&gt;  &lt;p&gt;I was following instructions on &lt;a href="http://www.codeplex.com/WCFSecurity/Wiki/View.aspx?title=How%20To%20-%20Perform%20Input%20Validation%20in%20WCF&amp;amp;referringTitle=How%20Tos" target="_blank"&gt;How To &amp;#8211; Perform Input Validation in WCF&lt;/a&gt; compiled by patterns&amp;amp;practice team lead by &lt;a href="http://blogs.msdn.com/jmeier" target="_blank"&gt;JD Meier&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;In a nutshell the process consists of creating 3 classes and tweaking a config file a &amp;quot;bit&amp;quot;.&lt;/p&gt;  &lt;p&gt;From the guide:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Step 4 &amp;#8211; Create a Class That Implements the Validation Logic &lt;/li&gt;    &lt;li&gt;Step 5 &amp;#8211; Create a Class That Implements a Custom Endpoint Behavior &lt;/li&gt;    &lt;li&gt;Step 6 &amp;#8211; Create a Class That Implements a Custom Configuration Element &lt;/li&gt;    &lt;li&gt;Step 7 &amp;#8211; Add the Custom Behavior to the Configuration File &lt;/li&gt;    &lt;li&gt;Step 8 &amp;#8211; Create an Endpoint Behavior and Map It to Use the Custom Behavior &lt;/li&gt;    &lt;li&gt;Step 9 &amp;#8211; Configure the Service Endpoint to Use the Endpoint Behavior &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I ended up with working sample built with Visual Studio 2008. I though it'd be good idea to share it to help you boost your productivity.&lt;/p&gt;  &lt;p&gt;Grab the Visual Studio project on my SkyDrive &lt;a href="http://cid-dd25b83e4ca261f7.skydrive.live.com/self.aspx/Visual%20Studio%20Projects/WCFInputValidation.zip" target="_blank"&gt;here&lt;/a&gt;. &lt;/p&gt; &lt;iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 66px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-dd25b83e4ca261f7.skydrive.live.com/embedrowdetail.aspx/Visual%20Studio%20Projects/WCFInputValidation.zip" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;  &lt;p&gt;Enjoy&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8550886" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Input+Validation/default.aspx">Input Validation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Development+Phase/default.aspx">Development Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category></item><item><title>patterns &amp; practices WCF Security Guidance Project - live on Codeplex</title><link>http://blogs.msdn.com/alikl/archive/2008/04/02/patterns-practices-wcf-security-guidance-project-live-on-codeplex.aspx</link><pubDate>Wed, 02 Apr 2008 10:53:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8350230</guid><dc:creator>alikl</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/alikl/comments/8350230.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=8350230</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=8350230</wfw:comment><description>&lt;p&gt;patterns &amp;amp; practices has recently released &lt;a href="http://www.codeplex.com/WCFSecurity/" target="_blank"&gt;WCF Security Guidance Project&lt;/a&gt;. &lt;a href="http://blogs.msdn.com/jmeier/" target="_blank"&gt;JD&lt;/a&gt;, the program manager behind the effort, &lt;a href="http://blogs.msdn.com/jmeier/archive/2008/03/27/patterns-and-practices-wcf-security-guidance-now-available.aspx" target="_blank"&gt;has been blogging about it&lt;/a&gt; too.It is evolving project but the initial content is fantastic already. It has &lt;a href="http://www.codeplex.com/WCFSecurity/Wiki/View.aspx?title=Application%20Scenarios&amp;amp;referringTitle=Home" target="_blank"&gt;Application Scenarios&lt;/a&gt;, &lt;a href="http://www.codeplex.com/WCFSecurity/Wiki/View.aspx?title=Video%20Index&amp;amp;referringTitle=Home" target="_blank"&gt;Video Index&lt;/a&gt;, but my favorites are How-To's:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.codeplex.com/WCFSecurity/Wiki/View.aspx?title=How%20To%20-%20Create%20and%20Install%20Temporary%20Certificates%20in%20WCF%20for%20Message%20Security%20During%20Development&amp;amp;referringTitle=How%20Tos" target="_blank"&gt;How To - Create and Install Temporary Certificates in WCF for Message Security During Development&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.codeplex.com/WCFSecurity/Wiki/View.aspx?title=How%20To%20-%20Create%20and%20Install%20Temporary%20Certificates%20in%20WCF%20for%20Transport%20Security%20during%20Development&amp;amp;referringTitle=How%20Tos" target="_blank"&gt;How To - Create and Install Temporary Certificates in WCF for Transport Security during Development&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.codeplex.com/WCFSecurity/Wiki/View.aspx?title=How%20To%20-%20Impersonate%20the%20Original%20Caller%20in%20WCF%20calling%20from%20Web%20Application&amp;amp;referringTitle=How%20Tos" target="_blank"&gt;How To - Impersonate the Original Caller in WCF calling from Web Application&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.codeplex.com/WCFSecurity/Wiki/View.aspx?title=How%20To%20-%20Impersonate%20the%20Original%20Caller%20in%20WCF%20calling%20from%20Windows%20Forms&amp;amp;referringTitle=How%20Tos" target="_blank"&gt;How To - Impersonate the Original Caller in WCF calling from Windows Forms&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.codeplex.com/WCFSecurity/Wiki/View.aspx?title=How%20To%20-%20Use%20netTcpBinding%20with%20Windows%20Authentication%20and%20Transport%20Security%20in%20WCF%20from%20Windows%20Forms&amp;amp;referringTitle=How%20Tos" target="_blank"&gt;How To - Use netTcpBinding with Windows Authentication and Transport Security in WCF from Windows Forms&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.codeplex.com/WCFSecurity/Wiki/View.aspx?title=How%20To%20-%20Use%20SQL%20Role%20Provider%20with%20Username%20Authentication%20in%20WCF%20calling%20from%20Windows%20Forms&amp;amp;referringTitle=How%20Tos" target="_blank"&gt;How To - Use SQL Role Provider with Username Authentication in WCF calling from Windows Forms&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.codeplex.com/WCFSecurity/Wiki/View.aspx?title=How%20To%20-%20Use%20SQL%20Role%20Provider%20with%20Windows%20Authentication%20in%20WCF%20calling%20from%20Windows%20Forms&amp;amp;referringTitle=How%20Tos" target="_blank"&gt;How To - Use SQL Role Provider with Windows Authentication in WCF calling from Windows Forms&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.codeplex.com/WCFSecurity/Wiki/View.aspx?title=How%20To%20-%20Use%20Username%20Authentication%20with%20the%20SQL%20Membership%20Provider%20and%20Message%20Security%20in%20WCF%20from%20Windows%20Forms&amp;amp;referringTitle=How%20Tos" target="_blank"&gt;How To - Use Username Authentication with the SQL Membership Provider and Message Security in WCF from Windows Forms&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.codeplex.com/WCFSecurity/Wiki/View.aspx?title=How%20To%20-%20Use%20wsHttpBinding%20with%20Windows%20Authentication%20and%20Message%20Security%20in%20WCF%20from%20Windows%20Forms&amp;amp;referringTitle=How%20Tos" target="_blank"&gt;How To - Use wsHttpBinding with Windows Authentication and Message Security in WCF from Windows Forms&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.codeplex.com/WCFSecurity/Wiki/View.aspx?title=How%20To%20-%20Use%20wsHttpBinding%20with%20Windows%20Authentication%20and%20Transport%20Security%20in%20WCF%20calling%20from%20Windows%20Forms&amp;amp;referringTitle=How%20Tos" target="_blank"&gt;How To - Use wsHttpBinding with Windows Authentication and Transport Security in WCF calling from Windows Forms&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Pure love.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8350230" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Development+Phase/default.aspx">Development Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Practices/default.aspx">Practices</category></item><item><title>How To Consume WCF Using AJAX Without ASP.NET</title><link>http://blogs.msdn.com/alikl/archive/2008/02/18/how-to-consume-wcf-using-ajax-without-asp-net.aspx</link><pubDate>Mon, 18 Feb 2008 23:35:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7779790</guid><dc:creator>alikl</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/alikl/comments/7779790.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=7779790</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=7779790</wfw:comment><description>&lt;p&gt;How to consume WCF services directly from Html client? How to add AJAX-like functionally to application that does not natively support ASP.NET AJAX like classic ASP, ASP.NET 1.1, or PHP?&lt;/p&gt;  &lt;p&gt;WCF that ships with .Net 3.5 provides capability to consume it from any JavaScript enabled client via XML or JSON encoding. There is new built in webHttpBinding that supports either JSON or XML encoded messages to be sent to WCF services.The functionality can dramatically improve performance and user experience.&lt;/p&gt;  &lt;p&gt;This post summarizes the steps to create and consume basic WCF service using webHttpBinding binding. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Summary of Steps &lt;/b&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;Step 1 &amp;#8211; Create WCF service.&lt;/b&gt; &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Step 2 &amp;#8211; Configure WCF end point.&lt;/b&gt; &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Step 3 &amp;#8211; Create JavaScript to invoke WCF service.&lt;/b&gt; &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Step 4 &amp;#8211; Test the solution.&lt;/b&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Next section describes each and every step in details&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Step 1 &amp;#8211; Create WCF service&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Open Visual Studio and create new WCF service project by choosing &amp;quot;WCF Service Application&amp;quot; template under &amp;quot;Web&amp;quot; project type. Name it Wcf2Ajax. Open IService1.cs file and create OperationContract as follows:&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: #606060"&gt;   1:&lt;/span&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: #606060"&gt;   2:&lt;/span&gt;  &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;interface&lt;/span&gt; IService1&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: #606060"&gt;   3:&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: #606060"&gt;   4:&lt;/span&gt;&amp;#160; &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: #606060"&gt;   5:&lt;/span&gt;      [OperationContract]&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: #606060"&gt;   6:&lt;/span&gt;      &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Sum2Integers(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; n1, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; n2);&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Open Service1.svc.cs file and add public method that accepts to integers and returns the sum of it. This is the functionality that will be exposed by the WCF service and consumed by JavaScript enabled client:&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: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Service1 : IService1&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: #606060"&gt;   2:&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;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Sum2Integers(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; n1, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; n2)&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: #606060"&gt;   4:&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;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; result = num1 + num2;&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: #606060"&gt;   6:&lt;/span&gt;&amp;#160; &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: #606060"&gt;   7:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; result.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;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;     }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;b&gt;Step 2 &amp;#8211; Configure WCF end point&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Open web.config file and add &amp;lt;binding&amp;gt; section to &amp;lt;system.serviceModel section. Add &amp;lt;webHttpBinding&amp;gt; to binding section:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;system.serviceModel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;bindings&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;webHttpBinding&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;binding &lt;/span&gt;&lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;AjaxBinding&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;webHttpBinding&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;bindings&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Add AjaxBehavior to &amp;lt;behaviors&amp;gt; section to support WCF invocation via AJAX:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;behaviors&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;endpointBehaviors&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;behavior &lt;/span&gt;&lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;AjaxBehavior&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;enableWebScript&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;behavior&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Configure WCF service's endpoint to use newly created binding:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;endpoint &lt;/span&gt;&lt;span style="color: red"&gt;address&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;ajaxEndpoint&lt;/span&gt;&amp;quot; 
          &lt;span style="color: red"&gt;behaviorConfiguration&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;AjaxBehavior&lt;/span&gt;&amp;quot; 
          &lt;span style="color: red"&gt;binding&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;webHttpBinding&lt;/span&gt;&amp;quot; 
          &lt;span style="color: red"&gt;bindingConfiguration&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;AjaxBinding&lt;/span&gt;&amp;quot; 
          &lt;span style="color: red"&gt;contract&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Wcf2Ajax.IService1&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&lt;b&gt;Step 3 &amp;#8211; Create JavaScript to invoke WCF service&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Add Html file to the solution by right clicking on the solution node in solution explorer and choosing &amp;quot;New Item...&amp;quot; and then &amp;quot;HTML Page&amp;quot; template. Name it WCFConsumer.htm. Add few HTML controls - two text boxes to accept two integers, one pure HTML button to trigger WCF call, and &amp;lt;span&amp;gt; element to present the result:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;input &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;text&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;num1&amp;quot; /&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;input &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;text&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;num2&amp;quot; /&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;br&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;input &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;button&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;onclick&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;CallWcfAjax()&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Call WCF via AJAX&amp;quot; /&amp;gt;
&lt;/span&gt;Result &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;span &lt;/span&gt;&lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;result&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;span&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Add &amp;lt;script&amp;gt; block to &amp;lt;header&amp;gt; section and add JavaSctip that builds HTTP request and wires invocation function to some event, say button click:&lt;/p&gt;

&lt;pre class="code"&gt;    &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;script &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;text/javascript&amp;quot;&amp;gt;
    function &lt;/span&gt;CallWcfAjax()
    {
        &lt;span style="color: blue"&gt;var &lt;/span&gt;xmlHttp = &lt;span style="color: blue"&gt;new &lt;/span&gt;ActiveXObject(&lt;span style="color: #a31515"&gt;&amp;quot;Microsoft.XmlHttp&amp;quot;&lt;/span&gt;);

        &lt;span style="color: blue"&gt;var &lt;/span&gt;url = &lt;span style="color: #a31515"&gt;&amp;quot;Service1.svc/ajaxEndpoint/&amp;quot;&lt;/span&gt;;
        url = url + &lt;span style="color: #a31515"&gt;&amp;quot;Sum2Integers&amp;quot;&lt;/span&gt;;

        &lt;span style="color: blue"&gt;var &lt;/span&gt;body = &lt;span style="color: #a31515"&gt;'{&amp;quot;n1&amp;quot;:'&lt;/span&gt;;
        body = body + document.getElementById(&lt;span style="color: #a31515"&gt;&amp;quot;num1&amp;quot;&lt;/span&gt;).value + &lt;span style="color: #a31515"&gt;',&amp;quot;n2&amp;quot;:'&lt;/span&gt;;
        body = body + document.getElementById(&lt;span style="color: #a31515"&gt;&amp;quot;num2&amp;quot;&lt;/span&gt;).value + &lt;span style="color: #a31515"&gt;'}'&lt;/span&gt;;
          
        &lt;span style="color: green"&gt;// Send the HTTP request
        &lt;/span&gt;xmlHttp.open(&lt;span style="color: #a31515"&gt;&amp;quot;POST&amp;quot;&lt;/span&gt;, url, &lt;span style="color: blue"&gt;true&lt;/span&gt;);
        xmlHttp.setRequestHeader(&lt;span style="color: #a31515"&gt;&amp;quot;Content-type&amp;quot;&lt;/span&gt;, &lt;span style="color: #a31515"&gt;&amp;quot;application/json&amp;quot;&lt;/span&gt;);
        xmlHttp.send(body);

        &lt;span style="color: green"&gt;// Create result handler 
        &lt;/span&gt;xmlHttp.onreadystatechange= &lt;span style="color: blue"&gt;function &lt;/span&gt;X()
        {
        
             &lt;span style="color: blue"&gt;if&lt;/span&gt;(xmlHttp.readyState == 4)
             {
                  &lt;span style="color: #a31515"&gt;&lt;font color="#333333"&gt;result.innerText&lt;/font&gt;&lt;/span&gt; = xmlHttp.responseText;
             }
        }
    }
    &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;script&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&lt;b&gt;Step 4 &amp;#8211; Test the solution&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Build the solution and navigate to WCFConsumer.htm. Provide two integers to both text boxes and hit &amp;quot;Call WCF via Ajax&amp;quot; button. You should expect for result similar as depicted below:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/ConsumeWCFServiceByAnyJavaScriptEnabledC_710F/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="123" alt="image" src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/ConsumeWCFServiceByAnyJavaScriptEnabledC_710F/image_thumb.png" width="381" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Parse the result to your needs.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;b&gt;My related post&lt;/b&gt;

&lt;p&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/12/31/asp-net-ajax-control-toolkit-basic-sample-for-dynamicpopulate-control.aspx"&gt;ASP.NET AJAX Control Toolkit - Basic Sample For DynamicPopulate Control&lt;/a&gt;&lt;/li&gt;

  &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/10/03/ajax-security-client-side-validation-is-for-usability-only-not-for-security.aspx"&gt;AJAX Security - Client Side Validation Is For Usability Only, Not For Security&lt;/a&gt;&lt;/li&gt;

  &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/07/26/wcf-security-in-intranet-scenario-thoughts-on-cons-and-pros.aspx"&gt;WCF Security In Intranet Scenario : Thoughts On Cons and Pros&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;b&gt;Related resources&lt;/b&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb885100.aspx" target="_blank"&gt;Creating WCF AJAX Services without ASP.NET&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Download Visual Studio 2008 project with the sample from my SkyDrive&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;
&lt;iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 66px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-dd25b83e4ca261f7.skydrive.live.com/embedrowdetail.aspx/Visual%20Studio%20Projects/Wcf2Ajax.zip" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7779790" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Development+Phase/default.aspx">Development Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Performance/default.aspx">Performance</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Planning+Phase/default.aspx">Planning Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/AJAX/default.aspx">AJAX</category></item><item><title>Examining WCF Diagnostic Traces Using Service Trace Viewer Tool (SvcTraceViewer.exe)</title><link>http://blogs.msdn.com/alikl/archive/2007/10/23/examining-wcf-diagnostic-traces-using-service-trace-viewer-tool-svctraceviewer-exe.aspx</link><pubDate>Tue, 23 Oct 2007 16:52:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5624225</guid><dc:creator>alikl</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/alikl/comments/5624225.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=5624225</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=5624225</wfw:comment><description>&lt;p&gt;Service Trace Viewer Tool (SvcTraceViewer.exe) tool comes with &lt;a href=" http://www.microsoft.com/downloads/details.aspx?familyid=C2B1E300-F358-4523-B479-F53D234CDCCF&amp;amp;displaylang=en" target="_blank"&gt;Microsoft® Windows® Software Development Kit for Windows Vista™ and .NET Framework 3.0 Runtime Components&lt;/a&gt;. It allows to view WCF diagnostics traces in very convenient way. "&lt;a href="http://msdn2.microsoft.com/en-us/library/aa751795.aspx" target="_blank"&gt;Using Service Trace Viewer for Viewing Correlated Traces and Troubleshooting&lt;/a&gt;" article explains how.&lt;/p&gt; &lt;p&gt;Specifically I used it for two scenarios&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Troubleshooting&lt;/strong&gt; when implementing &lt;a href="http://msdn2.microsoft.com/en-us/library/ms735117.aspx" target="_blank"&gt;Message Security with a Windows Client without Credential Negotiation&lt;/a&gt;. Using SvcTraceViewer.exe I spotted the following error message: &lt;em&gt;"&lt;font color="#d90000"&gt;The security timestamp is invalid because its creation time ('9/19/2007 5:43:39 PM') is in the future. Current time is '9/19/2007 8:43:42 AM' and allowed clock skew is '00:05:00'."&lt;/font&gt;&lt;/em&gt;&lt;font color="#d90000"&gt; &lt;/font&gt;I immediately understood that machines clocks are out of sync - which is super important for Kerberos to work properly.  &lt;li&gt;&lt;strong&gt;Examining message sizes&lt;/strong&gt; with different protection mechanisms and &lt;a href="http://msdn2.microsoft.com/en-us/library/Aa347692.aspx" target="_blank"&gt;levels&lt;/a&gt;. I needed to understand the impact of data protection mechanisms on general performance. See &lt;a href="http://msdn2.microsoft.com/en-us/library/ms733137.aspx" target="_blank"&gt;How Message and Transport Security compare&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;Related posts&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/07/26/wcf-security-in-intranet-scenario-thoughts-on-cons-and-pros.aspx"&gt;WCF Security In Intranet Scenario : Thoughts On Cons and Pros&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5624225" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Tools/default.aspx">Tools</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Deployment+Phase/default.aspx">Deployment Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Auditing+and+Logging/default.aspx">Auditing and Logging</category></item><item><title>How To: Create a “Hello World” WCF Service Using Visual Studio And IIS 6.0</title><link>http://blogs.msdn.com/alikl/archive/2007/10/16/how-to-create-a-hello-world-wcf-service-using-visual-studio-and-iis-6-0.aspx</link><pubDate>Tue, 16 Oct 2007 08:39:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5467427</guid><dc:creator>alikl</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/alikl/comments/5467427.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=5467427</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=5467427</wfw:comment><description>&lt;p&gt;&lt;a href="http://blogs.msdn.com/jmeier/archive/2007/10/15/how-to-create-a-hello-world-wcf-service-using-visual-studio.aspx" target="_blank"&gt;JD Meier walks through&lt;/a&gt; the creation of simple WCF services to be hosted in IIS 6.0.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Summary of Steps&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt; &lt;ul&gt; &lt;li&gt;Step 1.&amp;nbsp; Create the test service &lt;/li&gt; &lt;li&gt;Step 2. Add a Hello World Method &lt;/li&gt; &lt;li&gt;Step 3.&amp;nbsp; Test your WCF service &lt;/li&gt; &lt;li&gt;Step 4.&amp;nbsp; Enable meta-data for your WCF Service. &lt;/li&gt; &lt;li&gt;Step 5.&amp;nbsp; Create the test client. &lt;/li&gt; &lt;li&gt;Step 6.&amp;nbsp; Add a Web Services reference to your WCF Service. &lt;/li&gt; &lt;li&gt;Step 7.&amp;nbsp; Add the namespace to your &lt;/li&gt; &lt;li&gt;Step 8. Call your WCF service&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;p&gt;Must have in my developer toolbox.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5467427" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Development+Phase/default.aspx">Development Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category></item><item><title>WCF Security In Intranet Scenario : Thoughts On Cons and Pros</title><link>http://blogs.msdn.com/alikl/archive/2007/07/26/wcf-security-in-intranet-scenario-thoughts-on-cons-and-pros.aspx</link><pubDate>Thu, 26 Jul 2007 15:54:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4064637</guid><dc:creator>alikl</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/alikl/comments/4064637.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=4064637</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=4064637</wfw:comment><description>&lt;p&gt;I am researching on best practices with WCF security in terms of "YOU SHOUD" vs "YOU CAN". While it is great to have "How to" stuff I am also interested in "Why" angle. I have common simple scenario of WinForms client consuming WCF service inside corp walls with Active Directory deployed. Here is what I came up with while looking at &lt;a href="http://msdn2.microsoft.com/en-us/library/ms730158.aspx" target="_blank"&gt;Hosting Services&lt;/a&gt;&amp;nbsp;and &lt;a href="http://msdn2.microsoft.com/en-us/library/ms730301.aspx" target="_blank"&gt;Common Security Scenarios&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;I have built simple Hello World WCF service that accepts Person object/message and echoes back "Hello, " + Person.FirstName. I was using &lt;a href="http://msdn.microsoft.com/msdnmag/issues/06/08/servicestation/default.aspx" target="_blank"&gt;DataContract serialization&lt;/a&gt;. I think it really does not matter what it does in terms of biz logic. What really matters for me is how to &lt;em&gt;&lt;strong&gt;host&lt;/strong&gt;&lt;/em&gt; it, what &lt;strong&gt;&lt;em&gt;binding &lt;/em&gt;&lt;/strong&gt;to apply, and what &lt;strong&gt;&lt;em&gt;security &lt;/em&gt;&lt;/strong&gt;settings to configure.&lt;/p&gt; &lt;p&gt;For my intranet scenario "&lt;a href="http://msdn2.microsoft.com/ms735117.aspx"&gt;Message Security with a Windows Client without Credential Negotiation&lt;/a&gt;" would fit most I think. It utilizes Active Directory for authentication and message protection in transit as well saving me from messing with certs, transport level protection SSL, IPSEC style and plain vanilla UserName and Passwords. I think it is great and apparently it is a &lt;strong&gt;pro&lt;/strong&gt; part from security stand. &lt;/p&gt; &lt;p&gt;Since it uses wsHttpBinding binding&amp;nbsp;I thought it would be natural choice to host it in IIS rather self hosted as it shows up in the example. Here I earn what IIS has to offer vs what&amp;nbsp;I can write in C#...&lt;/p&gt; &lt;p&gt;I also&amp;nbsp;implemented&amp;nbsp;scenario where I used &lt;a href="http://msdn2.microsoft.com/en-us/library/ms731361.aspx" target="_blank"&gt;basicHttpBinding&lt;/a&gt;&amp;nbsp;with security set to None...&lt;/p&gt; &lt;p&gt;I fired up &lt;a href="http://fiddler2.com/fiddler2/version.asp" target="_blank"&gt;Fiddler2&lt;/a&gt;&amp;nbsp;to see what runs on the wire in both cases. The difference was pretty notable in terms of response time and payload size. Of course all these goodies that come from using Kerberos from my Active Directory friend - authentication and message protection - have their cost in terms of performance. I guess it is &lt;strong&gt;cons&lt;/strong&gt; part from performance stand.&amp;nbsp;I presume the time is spent for negotiation with Domain Controller and for cryptographic operations - encryption and signing - for message protection. The other &lt;strong&gt;cons&lt;/strong&gt; part would be message size that naturally inflates when encrypted.&lt;/p&gt; &lt;p&gt;&amp;nbsp;All my experiments are done with my &lt;a href="http://blogs.msdn.com/alikl/archive/2007/05/29/how-i-setup-lab-domain-using-vpc-2007.aspx" target="_blank"&gt;demo lab domain that is totally based on VPC 2007&lt;/a&gt;&amp;nbsp;so the numbers should be taken with caution but I presume that it can give some food for thoughts.&amp;nbsp;Consider simple message as follows:&lt;/p&gt; &lt;p&gt;&amp;lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&amp;gt;  &lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;lt;s:Body&amp;gt;  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SayHello xmlns="http://tempuri.org/"&amp;gt;  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;person xmlns:a="......." xmlns:i="....."&amp;gt;  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a:FirstName&amp;gt;Alik&amp;lt;/a:FirstName&amp;gt;  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a:LastName&amp;gt;Levin&amp;lt;/a:LastName&amp;gt;  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/person&amp;gt;  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;lt;/SayHello&amp;gt;  &lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/s:Body&amp;gt;  &lt;p&gt;&amp;lt;/s:Envelope&amp;gt;  &lt;p class="MsoNormal"&gt;Here is what&amp;nbsp;I captured using Fiddler:&lt;/p&gt; &lt;table class="MsoTableLightShadingAccent1" style="border-right: medium none; border-top: medium none; border-left: medium none; border-bottom: medium none; border-collapse: collapse; mso-border-top-alt: solid #4f81bd 1.0pt; mso-border-top-themecolor: accent1; mso-border-bottom-alt: solid #4f81bd 1.0pt; mso-border-bottom-themecolor: accent1; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellspacing="0" cellpadding="0" border="1" unselectable="on"&gt; &lt;tbody&gt; &lt;tr style="mso-yfti-irow: -1; mso-yfti-firstrow: yes"&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: #4f81bd 1pt solid; padding-left: 5.4pt; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: #4f81bd 1pt solid; mso-border-top-themecolor: accent1; mso-border-bottom-themecolor: accent1" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="mso-yfti-cnfc: 5"&gt;&lt;b&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: #4f81bd 1pt solid; padding-left: 5.4pt; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: #4f81bd 1pt solid; mso-border-top-themecolor: accent1; mso-border-bottom-themecolor: accent1" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="mso-yfti-cnfc: 1"&gt;&lt;b&gt;&lt;span style="font-size: 13pt; color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;basicHttpBinding&lt;/span&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: #4f81bd 1pt solid; padding-left: 5.4pt; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: #4f81bd 1pt solid; mso-border-top-themecolor: accent1; mso-border-bottom-themecolor: accent1" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="mso-yfti-cnfc: 1"&gt;&lt;b&gt;&lt;span style="font-size: 13pt; color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;wsHttpBinding&lt;/span&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="mso-yfti-irow: 0"&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; background: #d3dfee; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: medium none; mso-background-themecolor: accent1; mso-background-themetint: 63" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="mso-yfti-cnfc: 68"&gt;&lt;b&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;Message Encryption&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; background: #d3dfee; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: medium none; mso-background-themecolor: accent1; mso-background-themetint: 63" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="text-align: center; mso-yfti-cnfc: 64" align="center"&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; background: #d3dfee; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: medium none; mso-background-themecolor: accent1; mso-background-themetint: 63" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="text-align: center; mso-yfti-cnfc: 64" align="center"&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;V&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="mso-yfti-irow: 1"&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: medium none" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="mso-yfti-cnfc: 4"&gt;&lt;b&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;Message Signing&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: medium none" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="text-align: center" align="center"&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: medium none" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="text-align: center" align="center"&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;V&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="mso-yfti-irow: 2"&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; background: #d3dfee; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: medium none; mso-background-themecolor: accent1; mso-background-themetint: 63" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="mso-yfti-cnfc: 68"&gt;&lt;b&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;Bites sent&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; background: #d3dfee; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: medium none; mso-background-themecolor: accent1; mso-background-themetint: 63" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="text-align: center; mso-yfti-cnfc: 64" align="center"&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;584&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; background: #d3dfee; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: medium none; mso-background-themecolor: accent1; mso-background-themetint: 63" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="text-align: center; mso-yfti-cnfc: 64" align="center"&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;8,014&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="mso-yfti-irow: 3"&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: medium none" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="mso-yfti-cnfc: 4"&gt;&lt;b&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;Bites received&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: medium none" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="text-align: center" align="center"&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;420&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: medium none" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="text-align: center" align="center"&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;5,286&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="mso-yfti-irow: 4; mso-yfti-lastrow: yes"&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; background: #d3dfee; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-background-themecolor: accent1; mso-background-themetint: 63" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="mso-yfti-cnfc: 68"&gt;&lt;b&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;Time to last byte&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; background: #d3dfee; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-background-themecolor: accent1; mso-background-themetint: 63" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="text-align: center; mso-yfti-cnfc: 64" align="center"&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;20 ms&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border-right: medium none; padding-right: 5.4pt; border-top: medium none; padding-left: 5.4pt; background: #d3dfee; padding-bottom: 0in; border-left: medium none; width: 110.7pt; padding-top: 0in; border-bottom: #4f81bd 1pt solid; mso-border-bottom-themecolor: accent1; mso-background-themecolor: accent1; mso-background-themetint: 63" valign="top" width="148"&gt; &lt;p class="MsoNormal" style="text-align: center; mso-yfti-cnfc: 64" align="center"&gt;&lt;span style="color: #365f91; mso-themecolor: accent1; mso-themeshade: 191"&gt;231 ms&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;When designing my next WCF solution for intranet scenario I will sure try to utilize current IT investment like AD and IIS to provide first class security and hosting services while saving on maintenance costs. On other hand I must take into account performance part, this consideration should reflect on message size - for example, &lt;a href="http://blogs.msdn.com/alikl/archive/2007/07/06/typed-dataset-potential-performance-and-security-risk.aspx" target="_blank"&gt;think twice when tempted to use DataSet as DTO&lt;/a&gt;. It should also reflect on hosting options - using IIS 6.0 allows me to utilize Http traffic only.&lt;/p&gt; &lt;p&gt;Here is my take on intranet scenario where Windows 2003 Active Directory and IIS 6.0 deployed:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Utilize AD for message security and authentication.  &lt;li&gt;Host WCF in IIS 6.0. If I had Windows Server 2008 with IIS7 I'd go for WAS hosting for sure since it allows binding other than Http and I presume this should improve performance.  &lt;li&gt;Do not use DataSets for DTO rather carefully design custom most lightweight DTO (yes, invest as much time as needed for that one).  &lt;li&gt;Use DataContract serialization with opt-in approach (allows fine tune what gets&amp;nbsp;to the wires and what is not).&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;You have better suggestion for me around intranet scenario? If so, do not hesitate and drop me a line.&lt;/p&gt; &lt;p&gt;Here is even more food for thoughts &lt;a href="http://msdn2.microsoft.com/en-us/library/bb310550.aspx" target="_blank"&gt;A Performance Comparison of Windows Communication Foundation (WCF) with Existing Distributed Communication Technologies&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Bon appetite.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4064637" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Deployment+Phase/default.aspx">Deployment Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Performance/default.aspx">Performance</category></item><item><title>How To Hack WCF - New Technology, Old Hacking Tricks</title><link>http://blogs.msdn.com/alikl/archive/2007/03/04/how-to-hack-wcf-new-technology-old-hacking-tricks.aspx</link><pubDate>Sun, 04 Mar 2007 23:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1805472</guid><dc:creator>alikl</dc:creator><slash:comments>12</slash:comments><comments>http://blogs.msdn.com/alikl/comments/1805472.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=1805472</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=1805472</wfw:comment><description>&lt;P&gt;First of I'd like to thank &lt;A href="http://blogs.microsoft.co.il/blogs/bursteg/" mce_href="http://blogs.microsoft.co.il/blogs/bursteg/"&gt;Guy&lt;/A&gt; for his excellent screencast - very convenient, so thanks.&lt;/P&gt;
&lt;P&gt;Specifically I liked introductory screencast for WCF which can be found here: &lt;A title=http://blogs.microsoft.co.il/blogs/bursteg/pages/WCF-Introduction-Demo-_2800_ScreenCast_2900_.aspx href="http://blogs.microsoft.co.il/blogs/bursteg/pages/WCF-Introduction-Demo-_2800_ScreenCast_2900_.aspx" mce_href="http://blogs.microsoft.co.il/blogs/bursteg/pages/WCF-Introduction-Demo-_2800_ScreenCast_2900_.aspx"&gt;http://blogs.microsoft.co.il/blogs/bursteg/pages/WCF-Introduction-Demo-_2800_ScreenCast_2900_.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It is dubbed in Hebrew, but the screens are flipping in so logical way so that one who does not understand Hebrew will be fine - go for it - recommended a lot for WCF newbies like me.&lt;/P&gt;
&lt;P&gt;My interest was to understand the &lt;A class="" href="http://blogs.msdn.com/drnick/archive/2007/03/07/message-flow-interception-points.aspx" mce_href="http://blogs.msdn.com/drnick/archive/2007/03/07/message-flow-interception-points.aspx"&gt;pipeline&lt;/A&gt; that the &lt;A href="http://msdn2.microsoft.com/en-us/library/ms734675.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms734675.aspx"&gt;WCF Message&lt;/A&gt; goes through before it is put on the transport. The idea was to inject some custom modules (Inspectors)&amp;nbsp;in the pipeline. Why? Is not it clear? To mess around with the message - tamper it in it raw format before it goes down to the transport signed and protected. Why? To show that it DOES NOT matter what communication technology you use - HTTP, Remoting, MSMQ, WCF, RMI, CORBA, DCOM, MQ, &amp;lt;&amp;lt;fill in your own here&amp;gt;&amp;gt; - the basic principle of VALIDATING INPUT ON THE SERVER SIDE is immutable.&lt;/P&gt;
&lt;P&gt;Here I showed it for Web Services &lt;A href="http://blogs.microsoft.co.il/blogs/alikl/archive/2006/11/24/App-Architecture-with-Security-in-mind-_2D00_-Video_2C00_-Part-I.aspx" mce_href="http://blogs.microsoft.co.il/blogs/alikl/archive/2006/11/24/App-Architecture-with-Security-in-mind-_2D00_-Video_2C00_-Part-I.aspx"&gt;App Architecture with Security in mind - Video, Part I&lt;/A&gt;&amp;nbsp;(that was easy - &lt;A href="http://www.fiddlertool.com/" mce_href="http://www.fiddlertool.com/"&gt;Fiddler&lt;/A&gt; is of much help here)&lt;/P&gt;
&lt;P&gt;Then remoting came along - same result, here &lt;A href="http://blogs.microsoft.co.il/blogs/alikl/archive/2006/11/25/App-Architecture-with-Security-in-mind-_2D00_-Video_2C00_-Part-II.aspx" mce_href="http://blogs.microsoft.co.il/blogs/alikl/archive/2006/11/25/App-Architecture-with-Security-in-mind-_2D00_-Video_2C00_-Part-II.aspx"&gt;App Architecture with Security in mind - Video, Part II&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Now it is mighty WCF.&lt;/P&gt;
&lt;P&gt;I used excellent demo from &lt;A href="http://blogs.msdn.com/madhuponduru/default.aspx" mce_href="http://blogs.msdn.com/madhuponduru/default.aspx"&gt;Madhu&lt;/A&gt; here &lt;A title=http://blogs.msdn.com/madhuponduru/archive/2006/07/19/671922.aspx href="http://blogs.msdn.com/madhuponduru/archive/2006/07/19/671922.aspx" mce_href="http://blogs.msdn.com/madhuponduru/archive/2006/07/19/671922.aspx"&gt;http://blogs.msdn.com/madhuponduru/archive/2006/07/19/671922.aspx&lt;/A&gt;&amp;nbsp;that explained how to build &lt;A href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.dispatcher.iclientmessageinspector.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.dispatcher.iclientmessageinspector.aspx"&gt;IClientMessageInspector&lt;/A&gt; (NOTE - demo that works!)&lt;/P&gt;
&lt;P&gt;So here is the service contract:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image02.png" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image02.png" atomicselection="true"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=176 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image0_thumb.png" width=359 border=0 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image0_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;and the implementation:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image05.png" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image05.png" atomicselection="true"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=180 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image0_thumb1.png" width=416 border=0 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image0_thumb1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;and the client side validation:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image08.png" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image08.png" atomicselection="true"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=403 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image0_thumb2.png" width=692 border=0 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image0_thumb2.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;here is the client rejects the input:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image011.png" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image011.png" atomicselection="true"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=89 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image0_thumb3.png" width=389 border=0 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image0_thumb3.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;and here is the result of server processing for good input:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image014.png" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image014.png" atomicselection="true"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=76 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image0_thumb4.png" width=315 border=0 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image0_thumb4.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;after adding the custom message inspector, I am offered to tamper the massage before it is sent to the service and the resulting reply from the service is in red at the bottom:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image017.png" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image017.png" atomicselection="true"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=210 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image0_thumb5.png" width=623 border=0 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/WCFInterceptors_8951/image0_thumb5.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;Conclusion&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Does that mean that the communication technologies are bad? -&amp;nbsp;NO, it is the way &lt;FONT color=#ff0000&gt;&lt;STRONG&gt;WE&lt;/STRONG&gt;&lt;/FONT&gt; use it.&lt;/P&gt;
&lt;P&gt;Here is an basic example&amp;nbsp;for input validation in Web Services &lt;A href="http://blogs.microsoft.co.il/blogs/alikl/archive/2007/02/22/Web-Service-Input-Validation.aspx" mce_href="http://blogs.microsoft.co.il/blogs/alikl/archive/2007/02/22/Web-Service-Input-Validation.aspx"&gt;Web Service Input Validation&lt;/A&gt;&amp;nbsp;- it has link to regex usage that you can use on the server side for input validation.&lt;/P&gt;
&lt;P&gt;Enjoy&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1805472" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Input+Validation/default.aspx">Input Validation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Test+Phase/default.aspx">Test Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Fuzzing/default.aspx">Fuzzing</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category></item></channel></rss>