<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Eran Nachum's Blog</title>
    <link>http://www.eranachum.com/</link>
    <description>www.eranachum.com - Implementing &amp; executing my thoughts...</description>
    <language>en-us</language>
    <copyright>Eran Nachum</copyright>
    <lastBuildDate>Fri, 10 Oct 2008 07:07:35 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.8.5223.2</generator>
    <managingEditor>eranachum@hotmail.com</managingEditor>
    <webMaster>eranachum@hotmail.com</webMaster>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=d7a8e09f-9253-4189-9ffe-269bb76cc287</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,d7a8e09f-9253-4189-9ffe-269bb76cc287.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p class="MsoNormal" style="MARGIN: 0in 0in 0pt">
          <font size="2">
            <font face="Verdana">
              <span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">
                <font color="#000000">Microsoft
      come out with a new paper of comparing performance of WS in Microsoft platform and
      on IBM WebSphere.<br /></font>
              </span>
              <span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">
                <font color="#000000">MS
      comes out better (the purple bars graph) but then that is not surprising since this
      is an MS paper :-)</font>
              </span>
            </font>
          </font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 0pt">
          <font size="2">
            <font face="Verdana" color="#000000">
              <span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">
              </span>
            </font>
          </font> 
   </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 0pt">
          <span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">
          </span>
          <span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">
            <font face="Verdana" color="#000000" size="2">An
      interesting point is to see the comparison of different WCF configurations. Using
      NET-TCP gives almost double performance then using HTTP and self hosting http also
      gives a bit more then IIS hosted services.</font>
          </span>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 0pt">
          <span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">
            <font face="Verdana" color="#000000" size="2">
            </font>
          </span> 
   </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 0pt">
          <span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">
          </span>
          <span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">
            <font face="Verdana" color="#000000" size="2">Another
      significant point is that they calculated performance you get for what you pay for
      it and then MS solutions comes out the better deal by a few scales (the graph with
      the green bars).</font>
          </span>
        </p>
        <p>
          <img style="WIDTH: 532px; HEIGHT: 784px" height="784" src="http://www.eranachum.com/content/binary/clip_image002.jpg" width="531" border="0" />
        </p>
        <p>
          <img src="http://www.eranachum.com/content/binary/image_6.png" border="0" />
        </p>
        <p>
      More details in the spec <a href="http://www.eranachum.com/content/binary/TradeBenchmark_WinServer2008.pdf">here</a></p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=d7a8e09f-9253-4189-9ffe-269bb76cc287" />
      </body>
      <title>Comparing performance of WS on MS platform and IBM websphere</title>
      <guid>http://www.eranachum.com/PermaLink,guid,d7a8e09f-9253-4189-9ffe-269bb76cc287.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,d7a8e09f-9253-4189-9ffe-269bb76cc287.aspx</link>
      <pubDate>Fri, 10 Oct 2008 07:07:35 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
   &lt;font size=2&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;font color=#000000&gt;Microsoft
   come out with a new paper of comparing performance of WS in Microsoft platform and
   on IBM WebSphere.&lt;br&gt;
   &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;font color=#000000&gt;MS
   comes out better (the purple bars graph) but then that is not surprising since this
   is an MS paper :-)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
   &lt;font size=2&gt;&lt;font face=Verdana color=#000000&gt;&lt;span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
   &lt;span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;font face=Verdana color=#000000 size=2&gt;An
   interesting point is to see the comparison of different WCF configurations. Using
   NET-TCP gives almost double performance then using HTTP and self hosting http also
   gives a bit more then IIS hosted services.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
   &lt;span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;font face=Verdana color=#000000 size=2&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
   &lt;span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;font face=Verdana color=#000000 size=2&gt;Another
   significant point is that they calculated performance you get for what you pay for
   it and then MS solutions comes out the better deal by a few scales (the graph with
   the green bars).&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;img style="WIDTH: 532px; HEIGHT: 784px" height=784 src="http://www.eranachum.com/content/binary/clip_image002.jpg" width=531 border=0&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;img src="http://www.eranachum.com/content/binary/image_6.png" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
   More details in the spec &lt;a href="http://www.eranachum.com/content/binary/TradeBenchmark_WinServer2008.pdf"&gt;here&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=d7a8e09f-9253-4189-9ffe-269bb76cc287" /&gt;</description>
      <category>WCF;Web Services</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=f26f19af-dd89-424d-a159-1204640b0177</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,f26f19af-dd89-424d-a159-1204640b0177.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
      I want to recommend you about a great article that was written by a friend of mine
      - <strong>Boaz Davidoff</strong>, about duplex web services. 
   </p>
        <p>
      He found a great way for multiple clients to communicate through web services
      that push events/messages to the client.
   </p>
        <p>
      I will not get down on details here (this you can read on the article), but this
      is a great example of server-side multi-threading techniques.
   </p>
        <p>
      I read some related stuff about this issue on the web and found that Microsoft covered
      this solution under the WCF environment, but my POC has proven that Boaz's solution
      is much more easier to understand (if you don't have the minimal knowledge on WCF)
      and to implement or customize to your own requirements.
   </p>
        <p>
      So if you have a client application that requires <u>real time</u> information
      to be pushed from the server, or from other clients, this might be the ticket. 
   </p>
        <p>
      The article is on the codeproject.com site <a href="http://www.codeproject.com/KB/threads/DuplexWebService.aspx" target="_blank">here</a>.
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=f26f19af-dd89-424d-a159-1204640b0177" />
      </body>
      <title>Duplex Web Services</title>
      <guid>http://www.eranachum.com/PermaLink,guid,f26f19af-dd89-424d-a159-1204640b0177.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,f26f19af-dd89-424d-a159-1204640b0177.aspx</link>
      <pubDate>Tue, 29 Apr 2008 19:23:55 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
   I want to recommend you about a great article that was written by a friend of mine
   - &lt;strong&gt;Boaz Davidoff&lt;/strong&gt;, about duplex web services. 
&lt;/p&gt;
&lt;p&gt;
   He found a great way for multiple clients&amp;nbsp;to communicate through web services
   that push events/messages to the client.
&lt;/p&gt;
&lt;p&gt;
   I will not get down on details here (this you can read on the article), but&amp;nbsp;this
   is a great example of server-side multi-threading techniques.
&lt;/p&gt;
&lt;p&gt;
   I read some related stuff about this issue on the web and found that Microsoft covered
   this solution under the WCF environment, but my POC&amp;nbsp;has proven that Boaz's solution
   is much more easier to understand (if you don't have the minimal knowledge on WCF)
   and to implement or customize to your own requirements.
&lt;/p&gt;
&lt;p&gt;
   So if you have a client application that requires &lt;u&gt;real time&lt;/u&gt;&amp;nbsp;information
   to be pushed from the server, or from other clients, this might be the ticket.&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
   The article is on the codeproject.com site &lt;a href="http://www.codeproject.com/KB/threads/DuplexWebService.aspx" target=_blank&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=f26f19af-dd89-424d-a159-1204640b0177" /&gt;</description>
      <category>Multi-threading;Web Services</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=178f00fb-2fe6-48e9-992a-7abdb22518e8</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,178f00fb-2fe6-48e9-992a-7abdb22518e8.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      While search some interesting and innovating technological stuff on the web, I bumped
      into 2 articles regarding performance comparison between the classic .NET Remoting
      (published by Microsoft some years ago) and between WCF technology that ships as part
      of the .NET Framework 3.0.
   </p>
        <p>
      The <a href="http://geekswithblogs.net/marcel/archive/2007/04/12/111542.aspx" target="_blank">first
      one</a> has being published by Marcin Celej that claims that: <em>"Sending DataSet
      with .NET Remoting is faster (in any of cases I tested) than sending it with WCF".</em></p>
        <p>
      On the other hand, MSDN published also a comparison <a href="http://msdn2.microsoft.com/en-us/library/bb310550.aspx#wcfperform_topic3" target="_blank">article</a>,
      and the evidences were other than the above ones: <em>"When migrating distributed
      applications written with ... .NET Remoting to WCF, the performance is at least comparable
      to the other existing Microsoft distributed communication technologies ... WCF is
      ... approximately 25% faster than .NET Remoting".</em></p>
        <p>
      Graphs and schemes were published to illustrate the great findings by each one of
      them.
   </p>
        <p>
      I am a fan of Microsoft technologies - I admit it, but this issue sounds interesting
      and worth testing not? What do you think about it?
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=178f00fb-2fe6-48e9-992a-7abdb22518e8" />
      </body>
      <title>Who is Faster? Interesting...</title>
      <guid>http://www.eranachum.com/PermaLink,guid,178f00fb-2fe6-48e9-992a-7abdb22518e8.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,178f00fb-2fe6-48e9-992a-7abdb22518e8.aspx</link>
      <pubDate>Mon, 07 Jan 2008 23:57:58 GMT</pubDate>
      <description>&lt;p&gt;
   While search some interesting and innovating technological stuff on the web, I bumped
   into 2 articles regarding performance comparison between the classic .NET Remoting
   (published by Microsoft some years ago) and between WCF technology that ships as part
   of the .NET Framework 3.0.
&lt;/p&gt;
&lt;p&gt;
   The &lt;a href="http://geekswithblogs.net/marcel/archive/2007/04/12/111542.aspx" target="_blank"&gt;first
   one&lt;/a&gt; has being published by Marcin Celej that claims that: &lt;em&gt;&amp;quot;Sending DataSet
   with .NET Remoting is faster (in any of cases I tested) than sending it with WCF&amp;quot;.&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
   On the other hand, MSDN published also a comparison &lt;a href="http://msdn2.microsoft.com/en-us/library/bb310550.aspx#wcfperform_topic3" target="_blank"&gt;article&lt;/a&gt;,
   and the evidences were other than the above ones: &lt;em&gt;&amp;quot;When migrating distributed
   applications written with ... .NET Remoting to WCF, the performance is at least comparable
   to the other existing Microsoft distributed communication technologies ... WCF is
   ... approximately 25% faster than .NET Remoting&amp;quot;.&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
   Graphs and schemes were published to illustrate the great findings by each one of
   them.
&lt;/p&gt;
&lt;p&gt;
   I am a fan of Microsoft technologies - I admit it, but this issue sounds interesting
   and worth testing not? What do you think about it?
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=178f00fb-2fe6-48e9-992a-7abdb22518e8" /&gt;</description>
      <category>Web Services;WCF</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=7e3769f9-bf81-4b9f-9131-eddfac599ed4</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,7e3769f9-bf81-4b9f-9131-eddfac599ed4.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I have a problem (or used to have a problem...). In my working on web 2.0 startup,
      I bumped in a problem which in first thought looked to me as a simple one but after
      something like 5 seconds I figured out that it's actually a problem (or something
      to think about - I like this phrase much better ;)).
   </p>
        <p>
      So after this introduction, lets introduce the 'something to think about' issue: I
      had to run each period of time a set of tasks in order to update some database statuses.
      If my web application was hosted on a dedicated server, this one had be solved very
      quickly; windows service - I guess you thought about it yourselves...
   </p>
        <p>
      BUT, we are not going to host this web 2.0 application in a dedicated server (at least
      not now) and the scheduled task became a task itself, because (if you are web developers
      you'd better know) application is lives as long as there is at least one client that
      consumes it. When the last consumer is going home, also the application in going home
      to relax... 
   </p>
        <p>
          <strong>Now to the main question: how can we keep it alive?</strong>
        </p>
        <p>
      After doing some thinking between me and myself, gathering up some good resolutions
      and not I thought about good one; in your web application create a web service that
      most of its job is to expose a <em>KeepAlive</em> web method that will return a dummy
      value and will keep the web application alive all the time and also will perform the
      tasks that you to establish for permanent period of time.
   </p>
        <p>
      In your local PC, create a small desktop application in order to handle the tasks.
      This application will be a windows service that will run automatically under your
      machine every X interval and will ping the web service in order to keep the web application
      alive. 
   </p>
        <p>
      Note: the web service itself will know to execute the specific task itself every predefined
      period of time.
   </p>
        <p>
          <em>What about performance?</em> This solution could affect your web application performance
      (I think that you know the reason why), in this case you can create another wen
      application that will be placed in the same server and all its job is to be kept alive
      and perform your tasks.
   </p>
        <p>
      Any addition will be appreciated... I am going to write this web service now...
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=7e3769f9-bf81-4b9f-9131-eddfac599ed4" />
      </body>
      <title>Scheduled Task in Web Application - Is it can be done?</title>
      <guid>http://www.eranachum.com/PermaLink,guid,7e3769f9-bf81-4b9f-9131-eddfac599ed4.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,7e3769f9-bf81-4b9f-9131-eddfac599ed4.aspx</link>
      <pubDate>Mon, 03 Dec 2007 16:01:39 GMT</pubDate>
      <description>&lt;p&gt;
   I have a problem (or used to have a problem...). In my working on web 2.0 startup,
   I bumped in a problem which in first thought looked to me as a simple one but after
   something like 5 seconds I figured out that it's actually a problem (or something
   to think about - I like this phrase much better ;)).
&lt;/p&gt;
&lt;p&gt;
   So after this introduction, lets introduce the 'something to think about' issue: I
   had to run each period of time a set of tasks in order to update some database statuses.
   If my web application was hosted on a dedicated server, this one had be solved very
   quickly; windows service - I guess you thought about it yourselves...
&lt;/p&gt;
&lt;p&gt;
   BUT, we are not going to host this web 2.0 application in a dedicated server (at least
   not now) and the scheduled task became a task itself, because (if you are web developers
   you'd better know) application is lives as long as there is at least one client that
   consumes it. When the last consumer is going home, also the application in going home
   to relax... 
&lt;/p&gt;
&lt;p&gt;
   &lt;strong&gt;Now to the main question: how can we keep it alive?&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
   After doing some thinking between me and myself, gathering up some good resolutions
   and not I thought about good one; in your web application create a web service that
   most of its job is to expose a &lt;em&gt;KeepAlive&lt;/em&gt; web method that will return a dummy
   value and will keep the web application alive all the time and also will perform the
   tasks that you to establish for permanent period of time.
&lt;/p&gt;
&lt;p&gt;
   In your local PC, create a small desktop application in order to handle the tasks.
   This application will be a windows service that will run automatically under your
   machine every X interval and will ping the web service in order to keep the web application
   alive. 
&lt;/p&gt;
&lt;p&gt;
   Note: the web service itself will know to execute the specific task itself every predefined
   period of time.
&lt;/p&gt;
&lt;p&gt;
   &lt;em&gt;What about performance?&lt;/em&gt; This solution could affect your web application performance
   (I think that you know&amp;nbsp;the reason why), in this case you can create another wen
   application that will be placed in the same server and all its job is to be kept alive
   and perform your tasks.
&lt;/p&gt;
&lt;p&gt;
   Any addition will be appreciated... I am going to write this web service now...
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=7e3769f9-bf81-4b9f-9131-eddfac599ed4" /&gt;</description>
      <category>ASP.NET;Patterns;Web Services</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=2dbb3709-11c5-4a6e-9093-fadf8eb18e73</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,2dbb3709-11c5-4a6e-9093-fadf8eb18e73.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Hello and good week to all!
   </p>
        <p>
      These days I am starting to publish here (in my <a href="http://www.eranachum.com/" target="_blank">blog</a> ofcourse)
      a series of articles that discusses with Web Serivces and the most important issue
      - Security over Web Services (using Microsoft technology ofcourse), because it is
      quite simple to write a web service that receives/retrieves data and 'do you thing...',
      but the complexity comes when you want to secure this data that runs over non-secured
      protocols or web-lines.
   </p>
        <p>
      This article assumes that you are familier with web services, its porpuse and its
      implementation and assimilations, if not, you should read some basic tutorials before
      you start to read this article. (You can fine general example <a href="http://samples.gotdotnet.com/quickstart/aspplus/doc/writingservices.aspx" target="_blank">here</a>).
   </p>
        <p>
          <strong>
            <u>Introduction<br /></u>
          </strong>WS-SecurityProtocol defines all web services expansion security topics.
      Its goal is to let you build and use SOAP messages exchange in secured way. This term
      is quite flexble and it designed in a specific way in order to constitute the base
      of building a secured Web Service by the different security models like: SSL,
      Kerberos, PKI.<br />
      WS-SecurityProtocol supplies a full support for large number of security tokens, trusted
      domains, signature formats and encryption technologies.
   </p>
        <p>
      This component supplies 3 basic mechanisms: <strong>Message Confindentiality, Message
      Integrity, Security Token Propagation.</strong> These mechanisms, each one by it own,
      doesn't supplies perfect security solution, therefore in actual fact, WS-SecurityProtocol
      builds a block that uses a combination of all there mechanisms and different enhancements
      to supply a perfect sucurity solution
   </p>
        <p>
          <strong>
            <u>Main Facts<br /></u>
          </strong>Before I start explaining and showing the protocol's structure, I want
      to stand on the basic definitions and terms this protocol is uses:
   </p>
        <ul>
          <li>
            <strong>Claim</strong> - the client's claim (like: name, identity, key, group, rights
         and more...) 
      </li>
          <li>
            <strong>Security Token</strong> - represent a set of tokens. 
      </li>
          <li>
            <strong>Signed Security Token</strong> - this is a claimed and encrypted by a specific
         authority (like: Kerberos ticket or X.509 certificate) security token. 
      </li>
          <li>
            <strong>Proof-of-possession</strong> - information that used by a specific "proof
         process" in purpose to describe the sender data. 
      </li>
          <li>
            <strong>Integrity</strong> - a process that comes to note that the sent data hasn't
         changed while sending the message. 
      </li>
          <li>
            <strong>Confidentiality </strong>- a process that comes to ensure that the data is
         protected and just specific authorized 'players' are allowed to watch it. 
      </li>
          <li>
            <strong>Digest</strong> - an encrypted sum of the data sent stream. 
      </li>
          <li>
            <strong>Signature </strong>- this is an encrypted communication between the Proof-of-possession
         and the digest. This action creates a symetric key and public signatures. 
      </li>
          <li>
            <strong>Attachment</strong> - this is the physical data that is transfered using the
         SOAP messages, <u>but</u> is not a part of the SOAP envelop.</li>
        </ul>
        <p>
      We want to ensure that the SOAP message is encrypted properly to avoid dangers, like:
   </p>
        <ol>
          <li>
         The message could be readen and be changed by malicious user. 
      </li>
          <li>
         Malicious user can send fake message through the Web Service and by that to get secret
         information.</li>
        </ol>
        <p>
          <strong>Message Security Model</strong>
        </p>
        <p>
      The WS-SecurityProtocol works under the <strong>Message Security Model</strong>, that
      comes to prevent such cases like mentioned above. Its behavior is:
   </p>
        <p>
      The Security Token declares on Claims and Signatures, this mechanism supplies a proof
      to the knowledge of the sender (in simple words, the data that the sender holds).
      In addition, the Signature can bind itself with the Claims in the Security Token (in
      assumption the token is secured).
   </p>
        <p>
      Claim can be supported (or not) by "secured authority", which is a set of
      claims, which encrypted or digitally signed by this authority is usually represented
      by Signed Security Tokens. An example to Signed Security Token set is <strong>X.509</strong><strong>Certificate </strong>-
      which by this set of claims, the binding is executed between the client identity and
      the the public key.<br />
      Claim that is not supported by any "secured authority", can be secured only when
      the connection (binding) between the sender and the receiver is secured (secured line,
      like SSL etc...), for an example, they can agree on a specific message name that is
      accepted by both of them and by that only they will know that the message is meant
      for them (because they are both will look forward to get the same name).
   </p>
        <p>
      Another type of non-secured claim (which is not supported by any "secured authority")
      called <strong>proof-of-possesion</strong>. As I descibed earlier, this term confirms
      that the user has "pieces" of knowledge that diagnosed by the other 'players' which
      related to it. For an example, lets take a look of username/password security token,
      the proof-of-possession here, combines another security token in order to confirm
      the sender's claim. I need to note here, that Digital integrity (see above if you
      already forgot) for a message can be used as a proof-of-possession, but in theis case
      it will not considered as a security token.
   </p>
        <p>
          <strong>Message Protection</strong>
        </p>
        <p>
      Another model that comes to prevent such cases as mentioned above (remember...?).<br />
      This model claims that all the messages that are being sent, supposed to be encrypted
      in order to not be negatively affected by hostile factors. The Integrity based
      message is supplied by leverage of an XML signature with security tokens, in order
      to notice that the messages has been sent with no data changes of bad influences.
      This mechanism supports many signatures and players.
   </p>
        <p>
      A confidentiality (see above for a definition), based message, uses XML encryption
      with secutity tokens to ensure that the message's parts will be confidential.
   </p>
        <p>
      In order to supply the the maximum security to the SOAP message, that we'll
      want to send, there is a need to build the XML file that includes all the filters
      and headers definitions.<br />
      The structure of the XML file includes the &lt;Security&gt; tag, which symbolizes
      the security definitions. Under this tag it is possible to define all the information
      about the message security issue.
   </p>
        <p>
      An XML file cannot hold more that one security tag, this in purpose to allow that
      each tag (security XML) will taget to other destination. This tag and all its data
      under, represents the signature steps and the encryption type that the sender used
      with to send the message.
   </p>
        <p>
      A typical WS-SecurityProtocol example:
   </p>
        <p align="center">
          <img src="http://www.eranachum.com/content/binary/WS-SecurityProtocol.jpg" border="0" />
        </p>
        <p align="left">
      Line 001 and 002, describes the SOAP envelope. Line 003 opens the headers definitions
      that describes the message. Line 004 to 008, describes the sending message type, the
      source and destination. 
   </p>
        <p align="left">
      Line 009, open the Security's filters definitions. This label defines the security
      definitions that the receiver need to be up to (in order to watch the message ofcourse).
      This header label is closed in line 029.
   </p>
        <p align="left">
      Lines 010 to 012, describes the security token that message uses, here the usage is
      username token. (Here the assumption is that the password is well known by the service,
      and by that, only username is being sent).
   </p>
        <p align="left">
      Lines 013 to 028 defines the digital signature. By this example, the signature is
      based on the key that generated from the sender password. Lines 014 to 021,
      explains the digital signature. Line 015 defines how to normilize the sent information.
   </p>
        <p align="left">
      Lines 017 to 020, chooses the elements we want to signature. In this example (by line
      017), we can see that the body is digitally signed (&lt;s:Body&gt; label, which you
      can see in line 031).
   </p>
        <p align="left">
      Line 022, holds tha signature value that derivated from the encrypted information.
      Lines 023 to 027, holds an information about the security token location, which combined
      with the signature. In more explicit, lines 024 - 025, defines that this
      token is located in a specific URL address.
   </p>
        <p align="center">
          <img src="http://www.eranachum.com/content/binary/WS-SecurityToken02.jpg" border="0" />
        </p>
        <p align="left">
      Line 031 to 033 holds the message body.
   </p>
        <p align="left">
      That it for now. More tutorials at:
   </p>
        <ul>
          <li>
            <div align="left">
              <a href="http://www-128.ibm.com/developerworks/webservices/library/ws-secure/">http://www-128.ibm.com/developerworks/webservices/library/ws-secure/</a>
            </div>
          </li>
          <li>
            <div align="left">
              <a href="http://msdn.microsoft.com/library/en-us/dnglobspec/html/ws-securitypolicy.pdf">http://msdn.microsoft.com/library/en-us/dnglobspec/html/ws-securitypolicy.pdf</a>
            </div>
          </li>
        </ul>
        <p align="left">
      Comments will be appriciated...
   </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=2dbb3709-11c5-4a6e-9093-fadf8eb18e73" />
      </body>
      <title>Web Service Security Policy (WS-SecurityPolicy)</title>
      <guid>http://www.eranachum.com/PermaLink,guid,2dbb3709-11c5-4a6e-9093-fadf8eb18e73.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,2dbb3709-11c5-4a6e-9093-fadf8eb18e73.aspx</link>
      <pubDate>Sun, 23 Jul 2006 05:44:39 GMT</pubDate>
      <description>&lt;p&gt;
   Hello and good week to all!
&lt;/p&gt;
&lt;p&gt;
   These days I am starting to publish here (in my &lt;a href="http://www.eranachum.com/" target=_blank&gt;blog&lt;/a&gt; ofcourse)
   a series of articles that discusses with Web Serivces and the most important issue
   - Security over Web Services (using Microsoft technology ofcourse), because it is
   quite simple to write a web service that receives/retrieves data and 'do you thing...',
   but the complexity comes when you want to secure this data that runs over non-secured
   protocols or web-lines.
&lt;/p&gt;
&lt;p&gt;
   This article assumes that you are familier with web services, its porpuse and its
   implementation and assimilations, if not, you should read some basic tutorials before
   you start to read this article. (You can fine general example &lt;a href="http://samples.gotdotnet.com/quickstart/aspplus/doc/writingservices.aspx" target=_blank&gt;here&lt;/a&gt;).
&lt;/p&gt;
&lt;p&gt;
   &lt;strong&gt;&lt;u&gt;Introduction&lt;br&gt;
   &lt;/u&gt;&lt;/strong&gt;WS-SecurityProtocol defines all web services expansion security topics.
   Its goal is to let you build and use SOAP messages exchange in secured way. This term
   is quite flexble and it designed in a specific way in order to constitute&amp;nbsp;the&amp;nbsp;base
   of building a secured Web Service by the different security&amp;nbsp;models like: SSL,
   Kerberos, PKI.&lt;br&gt;
   WS-SecurityProtocol supplies a full support for large number of security tokens, trusted
   domains, signature formats and encryption technologies.
&lt;/p&gt;
&lt;p&gt;
   This component supplies 3 basic mechanisms: &lt;strong&gt;Message Confindentiality, Message
   Integrity, Security Token Propagation.&lt;/strong&gt; These mechanisms, each one by it own,
   doesn't supplies perfect security solution, therefore in actual fact, WS-SecurityProtocol
   builds a block that uses a combination of all there mechanisms and different enhancements
   to supply a perfect sucurity solution
&lt;/p&gt;
&lt;p&gt;
   &lt;strong&gt;&lt;u&gt;Main Facts&lt;br&gt;
   &lt;/u&gt;&lt;/strong&gt;Before I start explaining and showing the protocol's structure, I want
   to stand on the basic definitions and terms this protocol is uses:
&lt;/p&gt;
&lt;ul&gt;
   &lt;li&gt;
      &lt;strong&gt;Claim&lt;/strong&gt; - the client's claim (like: name, identity, key, group, rights
      and more...) 
   &lt;li&gt;
      &lt;strong&gt;Security Token&lt;/strong&gt; - represent a set of tokens. 
   &lt;li&gt;
      &lt;strong&gt;Signed Security Token&lt;/strong&gt; - this is a claimed and encrypted by a specific
      authority (like: Kerberos ticket or X.509 certificate) security token. 
   &lt;li&gt;
      &lt;strong&gt;Proof-of-possession&lt;/strong&gt; - information that used by a specific "proof
      process" in purpose to describe the sender data. 
   &lt;li&gt;
      &lt;strong&gt;Integrity&lt;/strong&gt; - a process that comes to note that the sent data hasn't
      changed while sending the message. 
   &lt;li&gt;
      &lt;strong&gt;Confidentiality &lt;/strong&gt;- a process that comes to ensure that the data is
      protected and just specific authorized 'players' are allowed to watch it. 
   &lt;li&gt;
      &lt;strong&gt;Digest&lt;/strong&gt; - an encrypted sum of the data sent stream. 
   &lt;li&gt;
      &lt;strong&gt;Signature &lt;/strong&gt;- this is an encrypted communication between the Proof-of-possession
      and the digest. This action creates a symetric key and public signatures. 
   &lt;li&gt;
      &lt;strong&gt;Attachment&lt;/strong&gt; - this is the physical data that is transfered using the
      SOAP messages, &lt;u&gt;but&lt;/u&gt; is not a part of the SOAP envelop.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
   We want to ensure that the SOAP message is encrypted properly to avoid dangers, like:
&lt;/p&gt;
&lt;ol&gt;
   &lt;li&gt;
      The message could be readen and be changed by malicious user. 
   &lt;li&gt;
      Malicious user can send fake message through the Web Service and by that to get secret
      information.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
   &lt;strong&gt;Message Security Model&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
   The WS-SecurityProtocol works under the &lt;strong&gt;Message Security Model&lt;/strong&gt;, that
   comes to prevent such cases like mentioned above. Its behavior is:
&lt;/p&gt;
&lt;p&gt;
   The Security Token declares on Claims and Signatures, this mechanism supplies a proof
   to the knowledge of the sender (in simple words, the data that the sender holds).
   In addition, the Signature can bind itself with the Claims in the Security Token (in
   assumption the token is secured).
&lt;/p&gt;
&lt;p&gt;
   Claim can be supported (or not) by "secured authority",&amp;nbsp;which is&amp;nbsp;a set of
   claims, which encrypted or digitally signed by this authority is usually represented
   by Signed Security Tokens. An example to Signed Security Token set is &lt;strong&gt;X.509&lt;/strong&gt; &lt;strong&gt;Certificate &lt;/strong&gt;-
   which by this set of claims, the binding is executed between the client identity and
   the the public key.&lt;br&gt;
   Claim that is not supported by any&amp;nbsp;"secured authority", can be secured only when
   the connection (binding) between the sender and the receiver is secured (secured line,
   like SSL etc...), for an example, they can agree on a specific message name that is
   accepted by both of them and by that only they will know that the message is meant
   for them (because they are both will look forward to get the same name).
&lt;/p&gt;
&lt;p&gt;
   Another type of non-secured claim (which is not supported by any "secured authority")
   called &lt;strong&gt;proof-of-possesion&lt;/strong&gt;. As I descibed earlier, this term confirms
   that the user has "pieces" of knowledge that diagnosed by the other 'players' which
   related to it. For an example, lets take a look of username/password security token,
   the proof-of-possession here, combines another security token in order to confirm
   the sender's claim. I need to note here, that Digital integrity (see above if you
   already forgot) for a message can be used as a proof-of-possession, but in theis case
   it will not considered as a security token.
&lt;/p&gt;
&lt;p&gt;
   &lt;strong&gt;Message Protection&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
   Another model that comes to prevent such cases as mentioned above (remember...?).&lt;br&gt;
   This&amp;nbsp;model claims that all the messages that are being sent, supposed to be encrypted
   in order to not be negatively affected&amp;nbsp;by hostile factors. The Integrity based
   message is supplied by leverage of an XML signature with security tokens, in order
   to notice that the messages has been sent with no data changes of bad influences.
   This mechanism supports many signatures and players.
&lt;/p&gt;
&lt;p&gt;
   A confidentiality (see above for a definition),&amp;nbsp;based message, uses XML encryption
   with secutity tokens to ensure that the message's parts will be confidential.
&lt;/p&gt;
&lt;p&gt;
   In order to supply the the maximum security&amp;nbsp;to the SOAP&amp;nbsp;message, that we'll
   want to send, there is a need to build the XML file that includes all the filters
   and headers definitions.&lt;br&gt;
   The structure of the XML file includes the &amp;lt;Security&amp;gt; tag, which&amp;nbsp;symbolizes
   the security definitions. Under this tag it is possible to define all the information
   about the message security issue.
&lt;/p&gt;
&lt;p&gt;
   An XML file cannot hold more that one security tag, this in purpose to allow that
   each tag (security XML) will taget to other destination. This tag and all its data
   under, represents the signature steps and the encryption type that the sender used
   with to send the message.
&lt;/p&gt;
&lt;p&gt;
   A typical WS-SecurityProtocol example:
&lt;/p&gt;
&lt;p align=center&gt;
   &lt;img src="http://www.eranachum.com/content/binary/WS-SecurityProtocol.jpg" border=0&gt;
&lt;/p&gt;
&lt;p align=left&gt;
   Line 001 and 002, describes the SOAP envelope. Line 003 opens the headers definitions
   that describes the message. Line 004 to 008, describes the sending message type, the
   source and destination. 
&lt;/p&gt;
&lt;p align=left&gt;
   Line 009, open the Security's filters definitions. This label defines the security
   definitions that the receiver need to be up to (in order to watch the message ofcourse).
   This header label is closed in line 029.
&lt;/p&gt;
&lt;p align=left&gt;
   Lines 010 to 012, describes the security token that message uses, here the usage is
   username token. (Here the assumption is that the password is well known by the service,
   and by that, only username is being sent).
&lt;/p&gt;
&lt;p align=left&gt;
   Lines 013 to 028 defines the digital signature. By this example, the signature is
   based&amp;nbsp;on&amp;nbsp;the key that generated from the sender password. Lines 014 to 021,
   explains the digital signature. Line 015 defines how to normilize the sent information.
&lt;/p&gt;
&lt;p align=left&gt;
   Lines 017 to 020, chooses the elements we want to signature. In this example (by line
   017), we can see that the body is digitally signed (&amp;lt;s:Body&amp;gt; label, which you
   can see in line 031).
&lt;/p&gt;
&lt;p align=left&gt;
   Line 022, holds tha signature value that derivated from the encrypted information.
   Lines 023 to 027, holds an information about the security token location, which combined
   with the signature. In&amp;nbsp;more explicit, lines 024 - 025, defines&amp;nbsp;that this
   token is located in a specific URL address.
&lt;/p&gt;
&lt;p align=center&gt;
   &lt;img src="http://www.eranachum.com/content/binary/WS-SecurityToken02.jpg" border=0&gt;
&lt;/p&gt;
&lt;p align=left&gt;
   Line 031 to 033 holds the message body.
&lt;/p&gt;
&lt;p align=left&gt;
   That it for now. More tutorials at:
&lt;/p&gt;
&lt;ul&gt;
   &lt;li&gt;
      &lt;div align=left&gt;&lt;a href="http://www-128.ibm.com/developerworks/webservices/library/ws-secure/"&gt;http://www-128.ibm.com/developerworks/webservices/library/ws-secure/&lt;/a&gt;
      &lt;/div&gt;
   &lt;li&gt;
      &lt;div align=left&gt;&lt;a href="http://msdn.microsoft.com/library/en-us/dnglobspec/html/ws-securitypolicy.pdf"&gt;http://msdn.microsoft.com/library/en-us/dnglobspec/html/ws-securitypolicy.pdf&lt;/a&gt;
      &lt;/div&gt;
   &lt;/li&gt;
&lt;/ul&gt;
&lt;p align=left&gt;
   Comments will be appriciated...
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=2dbb3709-11c5-4a6e-9093-fadf8eb18e73" /&gt;</description>
      <category>Security;Web Services</category>
    </item>
    <item>
      <trackback:ping>http://www.eranachum.com/Trackback.aspx?guid=3af4b1ec-d07c-465a-a34c-a9d7eac17041</trackback:ping>
      <pingback:server>http://www.eranachum.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.eranachum.com/PermaLink,guid,3af4b1ec-d07c-465a-a34c-a9d7eac17041.aspx</pingback:target>
      <dc:creator>eranachum@hotmail.com (Eran Nachum)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p dir="ltr">
          <font face="Verdana" color="#003300" size="2">
            <span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana">Hi!</span>
          </font>
        </p>
        <p class="MsoNormal" dir="ltr" style="DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left">
          <font face="Verdana" color="#003300" size="2">
            <span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana">In
      this post, I will examine several different approaches to work properly against </span>
          </font>
          <b>
            <font face="Verdana" color="#003300" size="2">
              <span style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana">web
      services.</span>
            </font>
          </b>
          <font face="Verdana" color="#003300" size="2">
            <span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"> I
      will explain the question (or problem, you can define it however you want) from the
      real life: You are working on an HR registration application and you want to register
      a new employee to the system, <u>but</u> the DB that holds all the employees details is
      located in remoted server. The actions that the application need to do are:</span>
          </font>
        </p>
        <ol type="1">
          <li class="MsoNormal" dir="ltr" style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left">
            <font face="Verdana" color="#003300" size="2">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">Check
         if the username is already exist in the repository of contents (first WS).</span>
            </font>
          </li>
          <li class="MsoNormal" dir="ltr" style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left">
            <font face="Verdana" color="#003300" size="2">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">Register
         the user and save her details to the system DB (second WS).</span>
            </font>
          </li>
          <li class="MsoNormal" dir="ltr" style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left">
            <font face="Verdana" color="#003300" size="2">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">Send
         a registration information to the user that all her details has been feed (third WS).</span>
            </font>
          </li>
        </ol>
        <p class="MsoNormal" dir="ltr" style="DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left">
          <font face="Verdana" color="#003300" size="2">
            <span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana">As
      we saw, every WS will do a single action, and the last 2 ones are dependent each other.</span>
          </font>
        </p>
        <p class="MsoNormal" dir="ltr" style="DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left">
          <font face="Verdana" color="#003300" size="2">
            <span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana">Now,
      the question that is being asked is how to handle those actions in exceptions cases,
      should I want to roll back or to complete the whole bunch of actions.</span>
          </font>
        </p>
        <p class="MsoNormal" dir="ltr" style="DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left">
          <font face="Verdana" color="#003300" size="2">
            <span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana">The
      approaches are:</span>
          </font>
        </p>
        <ol type="1">
          <li class="MsoNormal" dir="ltr" style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left">
            <b>
              <font face="Verdana" color="#003300" size="2">
                <span style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Verdana">Repeated
         requests handling:</span>
              </font>
            </b>
            <font face="Verdana" size="2">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"> This
         way handles the situation that the request is already has been sent to the remote
         server (by web service ofcourse), and we will want to know if the request handling
         is over. The way is to attach <strong>transaction indetifier </strong>to
         the request. By that, if the server is still busy (while processing the resuest),
         it will send an appropriate message to the client (status ID). This solution comes
         to prevent duplicates mesaages requests to the server. One more thing... </span>
            </font>
            <font face="Verdana" size="2">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">when
         implementing this sulotion, you need to consider and to support large number
         of transcactions (for further cases). By that, the client needs to know the ID of
         the transaction before sending the request to the server.</span>
            </font>
          </li>
          <li class="MsoNormal" style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left">
            <font face="Verdana" size="2">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
                <strong>Two-Phase
         commit: </strong>Before I start speaking the solution, I will explain this term: The <b>two-phase-commit
         protocol</b> is a distributed algorithm which lets all nodes in a distributed system
         agree to commit a transaction. The protocol results in either all nodes committing
         the transaction or aborting, even in the case of network failures or node failures.
         Now, t</span>
            </font>
            <font face="Verdana" size="2">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">he
         common approach, claims that algorithm is not "healthy" to use when working over
         web services, because if the web service is fails (or shuts down) in a middle of a
         transcation, there is a chance that the remote server won't know to send a message
         regarding the transaction state. The solution recommended here is to devide BIG transaction(s)
         to small transactions, when every small transaction will be handled by one web service. One
         more important thing is to plan properly the transactions flow, to prevent as much
         as minimum loss of data (if accured). I recommend to execute each action over one
         web service, and to call to a transaction manager web service that will be responsable
         to all the web services actions.</span>
            </font>
          </li>
          <li class="MsoNormal" style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left">
            <font face="Verdana" size="2">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
                <strong>Queued
         Processing:</strong> This approach claims that as long as the request is OK (no exception
         has been received), we will assume that action has been completed properly. To implement
         this approach you need to create a requests' queue (the requests that we will want
         to execute). Now, if no exception has been received, the queue will continue executing
         the further ones. If an exception has been received, the mechanism will roll back
         the related requests.</span>
            </font>
          </li>
          <li class="MsoNormal" style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left">
            <font face="Verdana" size="2">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
                <strong>Transaction
         Locking:</strong>
              </span>
            </font> When calling a web service (which is a part of a transaction), all
         its related resources will be locked in purpose not to allow other users to execute
         it. Real life example is withdrawaling cash from an ATM. When the user withdrawals
         the money from the machine, the transaction and his related data in the database
         is being locked, to prevent mismatch.
      </li>
        </ol>
        <p class="MsoNormal" style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left">
          <font face="Verdana" size="2">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">In
      summary, I spread here 4 different approaches to handle transactions over web services.
      I will be glad to have some comments if you have some.</span>
          </font>
        </p>
        <p class="MsoNormal" style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left">
          <font face="Verdana" size="2">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">Wellness
      untill next time, see you...</span>
          </font>
        </p>
        <img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=3af4b1ec-d07c-465a-a34c-a9d7eac17041" />
      </body>
      <title>Handling transactions over Web Services</title>
      <guid>http://www.eranachum.com/PermaLink,guid,3af4b1ec-d07c-465a-a34c-a9d7eac17041.aspx</guid>
      <link>http://www.eranachum.com/PermaLink,guid,3af4b1ec-d07c-465a-a34c-a9d7eac17041.aspx</link>
      <pubDate>Sun, 28 May 2006 06:22:55 GMT</pubDate>
      <description>&lt;p dir=ltr&gt;
   &lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;Hi!&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal dir=ltr style="DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left"&gt;
   &lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;In
   this post, I will examine several different approaches to work properly against &lt;/span&gt;&lt;/font&gt;&lt;b&gt;&lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;web
   services.&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt; I
   will explain the question (or problem, you can define it however you want) from the
   real life: You are working on an HR registration application and you want to register
   a new employee to the system, &lt;u&gt;but&lt;/u&gt; the DB that holds all the employees details&amp;nbsp;is
   located in remoted server. The actions that the application need to do are:&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;ol type=1&gt;
   &lt;li class=MsoNormal dir=ltr style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left"&gt;
      &lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Check
      if the username is already exist in the repository of contents (first WS).&lt;/span&gt;&lt;/font&gt; 
   &lt;li class=MsoNormal dir=ltr style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left"&gt;
      &lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Register
      the user and save her details to the system DB (second WS).&lt;/span&gt;&lt;/font&gt; 
   &lt;li class=MsoNormal dir=ltr style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left"&gt;
      &lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Send
      a registration information to the user that all her details has been feed (third WS).&lt;/span&gt;&lt;/font&gt; 
   &lt;/li&gt;
&lt;/ol&gt;
&lt;p class=MsoNormal dir=ltr style="DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left"&gt;
   &lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;As
   we saw, every WS will do a single action, and the last 2 ones are dependent each other.&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal dir=ltr style="DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left"&gt;
   &lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;Now,
   the question that is being asked is how to handle those actions in exceptions cases,
   should I want to roll back or to complete the whole bunch of actions.&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal dir=ltr style="DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left"&gt;
   &lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;The
   approaches are:&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;ol type=1&gt;
   &lt;li class=MsoNormal dir=ltr style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left"&gt;
      &lt;b&gt;&lt;font face=Verdana color=#003300 size=2&gt;&lt;span style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Repeated
      requests handling:&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;font face=Verdana size=2&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt; This
      way handles the situation&amp;nbsp;that the request is already has been sent to the remote
      server (by web service ofcourse), and we will want to know if the request handling
      is over. The way is to&amp;nbsp;attach &lt;strong&gt;transaction indetifier&amp;nbsp;&lt;/strong&gt;to
      the request. By that, if the server is still busy (while processing the resuest),
      it will send an appropriate message to the client (status ID). This solution comes
      to prevent duplicates mesaages requests to the server. One more thing... &lt;/span&gt;&lt;/font&gt;&lt;font face=Verdana size=2&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;when
      implementing this sulotion, you need to consider&amp;nbsp;and&amp;nbsp;to support large number
      of transcactions (for further cases). By that, the client needs to know the ID of
      the transaction before sending the request to the server.&lt;/span&gt;&lt;/font&gt; 
   &lt;li class=MsoNormal style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left"&gt;
      &lt;font face=Verdana size=2&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;strong&gt;Two-Phase
      commit: &lt;/strong&gt;Before I start speaking the solution, I will explain this term:&amp;nbsp;The &lt;b&gt;two-phase-commit
      protocol&lt;/b&gt; is a distributed algorithm which lets all nodes in a distributed system
      agree to commit a transaction. The protocol results in either all nodes committing
      the transaction or aborting, even in the case of network failures or node failures.
      Now, t&lt;/span&gt;&lt;/font&gt;&lt;font face=Verdana size=2&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;he
      common approach, claims that algorithm is not "healthy" to use when&amp;nbsp;working over
      web services, because if the web service is fails (or shuts down) in a middle of a
      transcation, there is a chance that the remote server won't know to send a message
      regarding the transaction state. The solution recommended here is to devide BIG transaction(s)
      to small transactions, when every small transaction will be handled by one web service.&amp;nbsp;One
      more important thing is to plan properly the transactions flow, to prevent as much
      as minimum loss of data (if accured). I recommend to execute each action over one
      web service, and to call to a transaction manager web service that will be responsable
      to all the web services actions.&lt;/span&gt;&lt;/font&gt; 
   &lt;li class=MsoNormal style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left"&gt;
      &lt;font face=Verdana size=2&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;strong&gt;Queued
      Processing:&lt;/strong&gt; This approach claims that as long as the request is OK (no exception
      has been received), we will assume that action has been completed properly. To implement
      this approach you need to create a requests' queue (the requests that we will want
      to execute). Now, if no exception has been received, the queue will continue executing
      the further ones. If an exception has been received, the mechanism will roll back
      the related requests.&lt;/span&gt;&lt;/font&gt; 
   &lt;li class=MsoNormal style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left"&gt;
      &lt;font face=Verdana size=2&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;strong&gt;Transaction
      Locking:&lt;/strong&gt;
      &lt;/font&gt; When calling a web service (which is a part of a transaction), all its related
      resources will be locked in purpose not to allow other users to execute it. Real life
      example is withdrawaling cash from an ATM. When the user withdrawals the money from
      the machine, the transaction and his related&amp;nbsp;data in the database is being locked,
      to prevent mismatch.&gt;
   &lt;/li&gt;
&lt;/ol&gt;
&lt;p class=MsoNormal style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left"&gt;
   &lt;font face=Verdana size=2&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;In summary,
   I spread here 4 different approaches to handle transactions over web services. I will
   be glad to have some comments if you have some.&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="COLOR: #003300; DIRECTION: ltr; unicode-bidi: embed; TEXT-ALIGN: left"&gt;
   &lt;font face=Verdana size=2&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Wellness
   untill next time, see you...&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.eranachum.com/aggbug.ashx?id=3af4b1ec-d07c-465a-a34c-a9d7eac17041" /&gt;</description>
      <category>Web Services</category>
    </item>
  </channel>
</rss>