<?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:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" version="2.0">
  <channel>
    <title>Matevž Gačnik's Weblog - Transactions</title>
    <link>https://www.request-response.com/blog/</link>
    <description>Technology Philanthropy</description>
    <image>
      <url>http://www.request-response.com/blog/images/favicon.jpg</url>
      <title>Matevž Gačnik's Weblog - Transactions</title>
      <link>https://www.request-response.com/blog/</link>
    </image>
    <language>en-us</language>
    <copyright>Matevz Gacnik</copyright>
    <lastBuildDate>Thu, 15 May 2008 15:24:19 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.1.8102.813</generator>
    <managingEditor>matevz.gacnik@gmail.com</managingEditor>
    <webMaster>matevz.gacnik@gmail.com</webMaster>
    <item>
      <trackback:ping>https://www.request-response.com/blog/Trackback.aspx?guid=a6f0a54f-31ae-4ccd-ad90-fdfbabba5d95</trackback:ping>
      <pingback:server>https://www.request-response.com/blog/pingback.aspx</pingback:server>
      <pingback:target>https://www.request-response.com/blog/PermaLink,guid,a6f0a54f-31ae-4ccd-ad90-fdfbabba5d95.aspx</pingback:target>
      <dc:creator>Matevz Gacnik</dc:creator>
      <wfw:comment>https://www.request-response.com/blog/CommentView,guid,a6f0a54f-31ae-4ccd-ad90-fdfbabba5d95.aspx</wfw:comment>
      <wfw:commentRss>https://www.request-response.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=a6f0a54f-31ae-4ccd-ad90-fdfbabba5d95</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
As promised, here are the sources from my <a href="http://www.ntk.si">NTK 2008</a> sessions <font size="1">[1]</font>.
</p>
        <p>
          <strong>Talk: Document Style Service Interfaces</strong>
        </p>
        <p>
Read the following <a href="http://www.request-response.com/blog/PermaLink,guid,ab874bc2-1546-48d1-a8aa-46f0bf876d93.aspx">blog
entry</a>, I tried to describe the concept in detail. Also, this <a href="http://www.request-response.com/blog/PermaLink,guid,a510f1dc-23bb-42aa-b683-a70c4740bfe5.aspx">blog post</a> discusses
issues when using large document parameters with reliable transport  (WS-RM)
channels.
</p>
        <p>
Demo: Document Style Service Interfaces [<a href="http://www.request-response.com/blog/content/binary/NTK2008DocStyleParamModels.zip">Download</a>]
</p>
        <p>
This demo defines a service interface with the document parameter model, ie. <font face="Courier New">Guid
CreatePerson(XmlDocument person)</font>. It shows three different approaches to creation
of the passed document:
</p>
        <ol>
          <li>
Raw XML creation 
</li>
          <li>
XML Serialization of the (attribute annotated) object graph 
</li>
          <li>
XML Serialization using the <em>client object model</em></li>
        </ol>
        <p>
Also, versioned schemas for the <font face="Courier New">Person</font> document are
shown, including the support for document validation and version independence.
</p>
        <p>
          <strong>Talk: Windows Server 2008 and Transactional NTFS</strong>
        </p>
        <p>
This <a href="http://www.request-response.com/blog/PermaLink,guid,bca19fa8-7ba8-43d8-873e-3a8cf03335cb.aspx">blog
entry</a> describes the concept.
</p>
        <p>
Demo 1: Logging using CLFS (Common Log File System) [<a href="http://www.request-response.com/blog/content/binary/NTK2008TxFCLFS.zip">Download</a>]<br />
Demo 2: NTFS Transactions using the File System, SQL, WCF [<a href="http://www.request-response.com/blog/content/binary/NTK2008TxFFSSQLWCF.zip">Download</a>]<br />
Demo 3: NTFS Transactions using the WCF, MTOM Transport [<a href="http://www.request-response.com/blog/content/binary/NTK2008TxFWCFMTOM.zip">Download</a>] <font size="1">[2]</font></p>
        <p>
          <font size="1">[1] All sources are in VS 2008 solution file format.<br />
[2] This transaction spans from the client, through the service boundary, to the server.</font>
        </p>
        <img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=a6f0a54f-31ae-4ccd-ad90-fdfbabba5d95" />
      </body>
      <title>Demos from the NT Conference 2008</title>
      <guid isPermaLink="false">https://www.request-response.com/blog/PermaLink,guid,a6f0a54f-31ae-4ccd-ad90-fdfbabba5d95.aspx</guid>
      <link>https://www.request-response.com/blog/PermaLink,guid,a6f0a54f-31ae-4ccd-ad90-fdfbabba5d95.aspx</link>
      <pubDate>Thu, 15 May 2008 15:24:19 GMT</pubDate>
      <description>&lt;p&gt;
As promised, here are the sources from&amp;nbsp;my &lt;a href="http://www.ntk.si"&gt;NTK 2008&lt;/a&gt; sessions &lt;font size=1&gt;[1]&lt;/font&gt;.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Talk: Document Style Service Interfaces&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Read the following &lt;a href="http://www.request-response.com/blog/PermaLink,guid,ab874bc2-1546-48d1-a8aa-46f0bf876d93.aspx"&gt;blog
entry&lt;/a&gt;, I tried to describe the concept in detail. Also, this &lt;a href="http://www.request-response.com/blog/PermaLink,guid,a510f1dc-23bb-42aa-b683-a70c4740bfe5.aspx"&gt;blog&amp;nbsp;post&lt;/a&gt; discusses
issues when using large document parameters with reliable transport&amp;nbsp; (WS-RM)
channels.
&lt;/p&gt;
&lt;p&gt;
Demo: Document Style Service Interfaces [&lt;a href="http://www.request-response.com/blog/content/binary/NTK2008DocStyleParamModels.zip"&gt;Download&lt;/a&gt;]
&lt;/p&gt;
&lt;p&gt;
This demo defines a service interface with the document parameter model, ie. &lt;font face="Courier New"&gt;Guid
CreatePerson(XmlDocument person)&lt;/font&gt;. It shows three different approaches to creation
of the passed document:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Raw XML creation 
&lt;li&gt;
XML Serialization of the (attribute annotated) object graph 
&lt;li&gt;
XML Serialization using the &lt;em&gt;client object model&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Also, versioned schemas for the &lt;font face="Courier New"&gt;Person&lt;/font&gt; document are
shown, including the support for document validation and version independence.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Talk: Windows Server 2008 and Transactional NTFS&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
This &lt;a href="http://www.request-response.com/blog/PermaLink,guid,bca19fa8-7ba8-43d8-873e-3a8cf03335cb.aspx"&gt;blog
entry&lt;/a&gt; describes the concept.
&lt;/p&gt;
&lt;p&gt;
Demo 1: Logging&amp;nbsp;using CLFS (Common Log File System)&amp;nbsp;[&lt;a href="http://www.request-response.com/blog/content/binary/NTK2008TxFCLFS.zip"&gt;Download&lt;/a&gt;]&lt;br&gt;
Demo 2:&amp;nbsp;NTFS Transactions using the File System, SQL, WCF&amp;nbsp;[&lt;a href="http://www.request-response.com/blog/content/binary/NTK2008TxFFSSQLWCF.zip"&gt;Download&lt;/a&gt;]&lt;br&gt;
Demo 3:&amp;nbsp;NTFS Transactions using the&amp;nbsp;WCF, MTOM Transport&amp;nbsp;[&lt;a href="http://www.request-response.com/blog/content/binary/NTK2008TxFWCFMTOM.zip"&gt;Download&lt;/a&gt;] &lt;font size=1&gt;[2]&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size=1&gt;[1] All sources are in VS 2008 solution file format.&lt;br&gt;
[2] This transaction spans from the client, through the service boundary, to the server.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=a6f0a54f-31ae-4ccd-ad90-fdfbabba5d95" /&gt;</description>
      <comments>https://www.request-response.com/blog/CommentView,guid,a6f0a54f-31ae-4ccd-ad90-fdfbabba5d95.aspx</comments>
      <category>.NET 3.5 - WCF</category>
      <category>Transactions</category>
      <category>XML</category>
    </item>
    <item>
      <trackback:ping>https://www.request-response.com/blog/Trackback.aspx?guid=bca19fa8-7ba8-43d8-873e-3a8cf03335cb</trackback:ping>
      <pingback:server>https://www.request-response.com/blog/pingback.aspx</pingback:server>
      <pingback:target>https://www.request-response.com/blog/PermaLink,guid,bca19fa8-7ba8-43d8-873e-3a8cf03335cb.aspx</pingback:target>
      <dc:creator>Matevz Gacnik</dc:creator>
      <wfw:comment>https://www.request-response.com/blog/CommentView,guid,bca19fa8-7ba8-43d8-873e-3a8cf03335cb.aspx</wfw:comment>
      <wfw:commentRss>https://www.request-response.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=bca19fa8-7ba8-43d8-873e-3a8cf03335cb</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Based on my <a href="http://www.request-response.com/blog/PermaLink,guid,c421ff72-d5bc-4b5f-8c52-ed5e73e8dd00.aspx">previous
post</a>, I managed to get <strong>distributed transaction</strong> scenario
working using <a href="http://wcf.netfx3.com/">WCF</a>, <a href="http://www.w3.org/TR/soap12-mtom/">MTOM</a> and <a href="http://www.ibm.com/developerworks/library/specification/ws-tx/">WS-AtomicTransactions</a>.
</p>
        <p>
This means that you have the option to transport <em>arbitrary files</em>, using transactional <strong>ACID</strong> semantics,
from the client, over HTTP and MTOM.
</p>
        <p>
The idea is to integrate a distributed transaction with <a href="http://msdn2.microsoft.com/En-US/library/aa365456.aspx">TxF</a>,
or NTFS file system transaction. This only works on Windows Server 2008 (Longhorn
Server) and Windows Vista. 
</p>
        <p>
Download: <a href="http://www.request-response.com/blog/content/binary/txf_wcf.zip">Sample
code</a></p>
        <p>
If the client starts a transaction then <em>all files</em> within it should be stored
on the server. If something fails or client does not commit, <em>no harm is done</em>.
The beauty of this is that it's all seamlessly integrated into the current communication/OS
stack.
</p>
        <p>
This is <strong>shipping technology</strong>; you just have to dive a little deeper
to use it.
</p>
        <p>
Here's the scenario:<br /><br /><img src="http://www.request-response.com/blog/images/txf_wcf1.jpg" /></p>
        <p>
There are a couple of issues that need to be addressed before we move to the implementation:
</p>
        <ul>
          <li>
            <strong>You should use the managed wrapper included <a href="http://www.request-response.com/blog/content/binary/txf_wcf.zip">here</a><br /></strong>There is support for <font face="Courier New">TransactedFile</font> and <font face="Courier New">TransactedDirectory</font> built
it. Next version of <a href="http://msdn2.microsoft.com/en-us/library/ms756482.aspx">VistaBridge</a> samples
will include an updated version of this wrapper.<br /><br /></li>
          <li>
            <strong>Limited distributed transactions support on a system drive<br /></strong>There is no way to get DTC a superior access coordinator<em></em>role for <a href="http://msdn2.microsoft.com/En-US/library/aa365456.aspx">TxF</a> on
the system drive (think <font face="Courier New">c:\</font> system drive). This is
a major downside in the current implementation of <a href="http://msdn2.microsoft.com/En-US/library/aa365456.aspx">TxF</a>,
since I would prefer that system/boot files would be transaction-locked anyway. You
have two options if you want to run the <a href="http://www.request-response.com/blog/content/binary/txf_wcf.zip">following
sample</a>:<br /><br /><ul><li><strong>Define secondary resource manager for your directory</strong><br />
This allows system drive resource manager to still protect system files, but creates
a secondary resource manager for the specified directory. Do this: 
<ul><li><font face="Courier New">fsutil resource create c:\txf</font></li><li><font face="Courier New">fsutil resource start c:\txf<br /></font>You can query your new secondary resource manager by <font face="Courier New">fsutil
resource info c:\txf</font>.<br /><br /></li></ul></li><li><strong>Use another partition<br /></strong>Any partition outside the system partition is ok. You cannot use network
shares, but <em>USB keys will work</em>. Plug it in and change the paths as defined
at the end of this post.</li></ul></li>
        </ul>
        <p>
OK, here we go.
</p>
        <p>
Here's the service contract:
</p>
        <p>
          <font face="Courier New">[ServiceContract(SessionMode = SessionMode.Allowed)]<br />
interface ITransportFiles<br />
{<br />
   [OperationContract]<br />
   [TransactionFlow(TransactionFlowOption.Allowed)]<br />
   byte[] GetFile(string name);</font>
        </p>
        <p>
          <font face="Courier New">   [OperationContract]<br />
   [TransactionFlow(TransactionFlowOption.Allowed)]<br />
   void PutFile(byte[] data, string name);<br />
} </font>
        </p>
        <p>
We allow the sessionful binding (it's not <em>required</em>, though) and allow transactions
to flow from the client side. Again, transactions are not <em>mandatory</em>, since
client may opt-out of using them and just transport files without a transaction.
</p>
        <p>
The provided transport mechanism uses <a href="http://www.w3.org/TR/soap12-mtom/">MTOM</a>,
since the contract's parameter model is appropriate for it and because it's much more
effective transferring binary data.
</p>
        <p>
So here's the service config:
</p>
        <p>
          <font face="Courier New">&lt;system.serviceModel&gt;<br />
  &lt;bindings&gt;<br />
    &lt;wsHttpBinding&gt;<br /><strong>      &lt;binding name="MTOMBinding"<br />
          transactionFlow="true"<br />
          messageEncoding="Mtom"<br />
          maxReceivedMessageSize="10485760"&gt;<br />
        &lt;readerQuotas maxArrayLength="10485760"/&gt;</strong><br />
      &lt;/binding&gt;<br />
    &lt;/wsHttpBinding&gt;<br />
  &lt;/bindings&gt;<br />
  &lt;services&gt;<br />
    &lt;service name="WCFService.TransportService"&gt;<br />
      &lt;host&gt;<br />
        &lt;baseAddresses&gt;<br />
          &lt;add baseAddress="</font>
          <font face="Courier New">http://localhost:555/transportservice"</font>
          <font face="Courier New">&gt;<br />
        &lt;/baseAddresses&gt;<br />
      &lt;/host&gt;<br />
      &lt;endpoint address=""<br />
          binding="wsHttpBinding"<br /><strong>          bindingConfiguration="MTOMBinding"<br /></strong>          contract="WCFService.ITransportFiles"/&gt;<br />
    &lt;/service&gt;<br />
  &lt;/services&gt;<br />
&lt;/system.serviceModel&gt;</font>
        </p>
        <p>
Here, <font face="Courier New">MTOMBinding</font> is being used to specify <a href="http://www.w3.org/TR/soap12-mtom/">MTOM</a> wire
encoding. Also, quotas and <font face="Courier New">maxReceivedMessageSize</font> attribute
is being adjusted to 10 MB, since we are probably transferring larger binary files.
</p>
        <p>
Service implementation is straight forward:
</p>
        <p>
          <font face="Courier New">[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]<br />
class TransportService : ITransportFiles<br />
{<br />
    [OperationBehavior(TransactionScopeRequired = true)]<br /><strong>    public byte[] GetFile(string name)<br /></strong>    {<br />
        Console.WriteLine("GetFile: {0}", name);<br />
        Console.WriteLine("Distributed Tx ID: {0}",<br />
          Transaction.Current.TransactionInformation.DistributedIdentifier);<br />
        return ReadFully(TransactedFile.Open(@"C:\TxF\Service\"
+ name,<br />
          FileMode.Open, FileAccess.Read,
FileShare.Read), 0);<br />
    }</font>
        </p>
        <p>
          <font face="Courier New">    [OperationBehavior(TransactionScopeRequired
= true)]<br /><strong>    public void PutFile(byte[] data, string filename)<br /></strong>    {<br />
        Console.WriteLine("PutFile: {0}", filename);<br />
        Console.WriteLine("Distributed Tx ID: {0}",<br />
          Transaction.Current.TransactionInformation.DistributedIdentifier);</font>
        </p>
        <p>
          <font face="Courier New">        using (BinaryWriter
bw = new BinaryWriter(<br />
            TransactedFile.Open(@"C:\TxF\Service\"
+ filename,<br />
              FileMode.Create,
FileAccess.Write, FileShare.Write)))<br />
        {<br />
            bw.Write(data,
0, data.Length);<br />
            
<br />
            // clean up<br />
            bw.Flush();<br />
        }<br />
    }<br />
}</font>
        </p>
        <p>
Client does four things:
</p>
        <ol>
          <li>
Sends three files (client - server) - no transaction 
</li>
          <li>
Gets three files (server - client) - no transaction 
</li>
          <li>
Sends three files (client - server) - distributed transaction, all or nothing 
</li>
          <li>
Gets three files (server - client) - distributed transaction, all or nothing</li>
        </ol>
        <p>
Before you run:
</p>
        <ul>
          <li>
Decide on the secondary resource manager option (system drive, enable it using <font face="Courier New">fsutil.exe</font>)
or use another partition (USB key) 
</li>
          <li>
Change the paths to your scenario. The sample uses <font face="Courier New">C:\TxF</font>, <font face="Courier New">C:\TxF\Service</font> and <font face="Courier New">C:\TxF\Client</font> and
a secondary resource manager. Create these directories before running the sample.</li>
        </ul>
        <p>
Download: <a href="http://www.request-response.com/blog/content/binary/txf_wcf.zip">Sample
code</a></p>
        <p>
          <font color="#a9a9a9" size="1">This sample is provided without any warranty. It's
a sample, so don't use it in production environments.</font>
        </p>
        <img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=bca19fa8-7ba8-43d8-873e-3a8cf03335cb" />
      </body>
      <title>Managed TxF: Distributed Transactions and Transactional NTFS</title>
      <guid isPermaLink="false">https://www.request-response.com/blog/PermaLink,guid,bca19fa8-7ba8-43d8-873e-3a8cf03335cb.aspx</guid>
      <link>https://www.request-response.com/blog/PermaLink,guid,bca19fa8-7ba8-43d8-873e-3a8cf03335cb.aspx</link>
      <pubDate>Mon, 23 Jul 2007 20:54:13 GMT</pubDate>
      <description>&lt;p&gt;
Based on my &lt;a href="http://www.request-response.com/blog/PermaLink,guid,c421ff72-d5bc-4b5f-8c52-ed5e73e8dd00.aspx"&gt;previous
post&lt;/a&gt;, I&amp;nbsp;managed to get &lt;strong&gt;distributed transaction&lt;/strong&gt; scenario
working using &lt;a href="http://wcf.netfx3.com/"&gt;WCF&lt;/a&gt;, &lt;a href="http://www.w3.org/TR/soap12-mtom/"&gt;MTOM&lt;/a&gt; and &lt;a href="http://www.ibm.com/developerworks/library/specification/ws-tx/"&gt;WS-AtomicTransactions&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
This means that you have the option to transport &lt;em&gt;arbitrary files&lt;/em&gt;, using transactional &lt;strong&gt;ACID&lt;/strong&gt; semantics,
from the client, over HTTP and MTOM.
&lt;/p&gt;
&lt;p&gt;
The idea is to integrate a distributed transaction with &lt;a href="http://msdn2.microsoft.com/En-US/library/aa365456.aspx"&gt;TxF&lt;/a&gt;,
or NTFS file system transaction. This only works on Windows Server 2008 (Longhorn
Server) and Windows Vista. 
&lt;/p&gt;
&lt;p&gt;
Download: &lt;a href="http://www.request-response.com/blog/content/binary/txf_wcf.zip"&gt;Sample
code&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
If the client starts a transaction then &lt;em&gt;all files&lt;/em&gt; within it should be stored
on the server. If something fails or client does not commit, &lt;em&gt;no harm is done&lt;/em&gt;.
The beauty of this is that it's all seamlessly integrated into the current communication/OS
stack.
&lt;/p&gt;
&lt;p&gt;
This is &lt;strong&gt;shipping technology&lt;/strong&gt;; you just have to dive a little deeper
to use it.
&lt;/p&gt;
&lt;p&gt;
Here's the scenario:&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.request-response.com/blog/images/txf_wcf1.jpg"&gt;
&lt;/p&gt;
&lt;p&gt;
There are a couple of issues that need to be addressed before we move to the implementation:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You should use the managed wrapper included &lt;a href="http://www.request-response.com/blog/content/binary/txf_wcf.zip"&gt;here&lt;/a&gt;
&lt;br&gt;
&lt;/strong&gt;There is support for &lt;font face="Courier New"&gt;TransactedFile&lt;/font&gt; and &lt;font face="Courier New"&gt;TransactedDirectory&lt;/font&gt; built
it. Next version of &lt;a href="http://msdn2.microsoft.com/en-us/library/ms756482.aspx"&gt;VistaBridge&lt;/a&gt; samples
will include an updated version of this wrapper.&lt;br&gt;
&lt;br&gt;
&lt;li&gt;
&lt;strong&gt;Limited distributed transactions support on a system drive&lt;br&gt;
&lt;/strong&gt;There is no way to get DTC a superior access coordinator&lt;em&gt; &lt;/em&gt;role for &lt;a href="http://msdn2.microsoft.com/En-US/library/aa365456.aspx"&gt;TxF&lt;/a&gt; on
the system drive (think &lt;font face="Courier New"&gt;c:\&lt;/font&gt; system drive). This is
a major downside in the current implementation of &lt;a href="http://msdn2.microsoft.com/En-US/library/aa365456.aspx"&gt;TxF&lt;/a&gt;,
since I would prefer that system/boot files would be transaction-locked anyway. You
have two options if you want to run the &lt;a href="http://www.request-response.com/blog/content/binary/txf_wcf.zip"&gt;following
sample&lt;/a&gt;:&lt;br&gt;
&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Define secondary resource manager for your directory&lt;/strong&gt;
&lt;br&gt;
This allows system drive resource manager to still protect system files, but creates
a secondary resource manager for the specified directory. Do this: 
&lt;ul&gt;
&lt;li&gt;
&lt;font face="Courier New"&gt;fsutil resource create c:\txf&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;fsutil resource start c:\txf&lt;br&gt;
&lt;/font&gt;You can query your new secondary resource manager by &lt;font face="Courier New"&gt;fsutil
resource info c:\txf&lt;/font&gt;.&lt;br&gt;
&lt;br&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
&lt;strong&gt;Use another partition&lt;br&gt;
&lt;/strong&gt;Any partition outside the system partition is ok. You cannot use network
shares, but &lt;em&gt;USB keys will work&lt;/em&gt;. Plug it in and change the paths as defined
at the end of this post.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
OK, here we go.
&lt;/p&gt;
&lt;p&gt;
Here's the service contract:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;[ServiceContract(SessionMode = SessionMode.Allowed)]&lt;br&gt;
interface ITransportFiles&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp; [OperationContract]&lt;br&gt;
&amp;nbsp;&amp;nbsp; [TransactionFlow(TransactionFlowOption.Allowed)]&lt;br&gt;
&amp;nbsp;&amp;nbsp; byte[] GetFile(string name);&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp; [OperationContract]&lt;br&gt;
&amp;nbsp;&amp;nbsp; [TransactionFlow(TransactionFlowOption.Allowed)]&lt;br&gt;
&amp;nbsp;&amp;nbsp; void PutFile(byte[] data, string name);&lt;br&gt;
}&amp;nbsp;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
We allow the sessionful binding (it's not &lt;em&gt;required&lt;/em&gt;, though) and allow transactions
to flow from the client side. Again, transactions are not &lt;em&gt;mandatory&lt;/em&gt;, since
client may opt-out of using them and just transport files without a transaction.
&lt;/p&gt;
&lt;p&gt;
The provided transport mechanism uses &lt;a href="http://www.w3.org/TR/soap12-mtom/"&gt;MTOM&lt;/a&gt;,
since the contract's parameter model is appropriate for it and because it's much more
effective transferring binary data.
&lt;/p&gt;
&lt;p&gt;
So here's the service config:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;lt;system.serviceModel&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;bindings&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;wsHttpBinding&amp;gt;&lt;br&gt;
&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;binding name="MTOMBinding"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; transactionFlow="true"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; messageEncoding="Mtom"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxReceivedMessageSize="10485760"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;readerQuotas maxArrayLength="10485760"/&amp;gt;&lt;/strong&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/binding&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/wsHttpBinding&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/bindings&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;services&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;service name="WCFService.TransportService"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;host&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;baseAddresses&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add baseAddress="&lt;/font&gt;&lt;font face="Courier New"&gt;http://localhost:555/transportservice"&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/baseAddresses&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/host&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpoint address=""&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; binding="wsHttpBinding"&lt;br&gt;
&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingConfiguration="MTOMBinding"&lt;br&gt;
&lt;/strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contract="WCFService.ITransportFiles"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/service&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/services&amp;gt;&lt;br&gt;
&amp;lt;/system.serviceModel&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
Here, &lt;font face="Courier New"&gt;MTOMBinding&lt;/font&gt; is being used to specify &lt;a href="http://www.w3.org/TR/soap12-mtom/"&gt;MTOM&lt;/a&gt; wire
encoding. Also, quotas and &lt;font face="Courier New"&gt;maxReceivedMessageSize&lt;/font&gt; attribute
is being adjusted to 10 MB, since we are probably transferring larger binary files.
&lt;/p&gt;
&lt;p&gt;
Service implementation is straight forward:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]&lt;br&gt;
class TransportService : ITransportFiles&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [OperationBehavior(TransactionScopeRequired = true)]&lt;br&gt;
&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public byte[] GetFile(string name)&lt;br&gt;
&lt;/strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("GetFile: {0}", name);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("Distributed Tx ID: {0}",&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Transaction.Current.TransactionInformation.DistributedIdentifier);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ReadFully(TransactedFile.Open(@"C:\TxF\Service\"
+ name,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FileMode.Open, FileAccess.Read,
FileShare.Read), 0);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [OperationBehavior(TransactionScopeRequired
= true)]&lt;br&gt;
&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void PutFile(byte[] data, string filename)&lt;br&gt;
&lt;/strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("PutFile: {0}", filename);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("Distributed Tx ID: {0}",&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Transaction.Current.TransactionInformation.DistributedIdentifier);&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (BinaryWriter
bw = new BinaryWriter(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TransactedFile.Open(@"C:\TxF\Service\"
+ filename,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileMode.Create,
FileAccess.Write, FileShare.Write)))&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bw.Write(data,
0, data.Length);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // clean up&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bw.Flush();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
Client does four things:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Sends three files (client - server) - no transaction 
&lt;li&gt;
Gets three files (server - client) - no transaction 
&lt;li&gt;
Sends three files (client - server) - distributed transaction, all or nothing 
&lt;li&gt;
Gets three files (server - client) - distributed transaction, all or nothing&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Before you run:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Decide on the secondary resource manager option (system drive, enable it using &lt;font face="Courier New"&gt;fsutil.exe&lt;/font&gt;)
or use another partition (USB key) 
&lt;li&gt;
Change the paths to your scenario. The sample uses &lt;font face="Courier New"&gt;C:\TxF&lt;/font&gt;, &lt;font face="Courier New"&gt;C:\TxF\Service&lt;/font&gt; and &lt;font face="Courier New"&gt;C:\TxF\Client&lt;/font&gt; and
a secondary resource manager. Create these directories before running the sample.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Download: &lt;a href="http://www.request-response.com/blog/content/binary/txf_wcf.zip"&gt;Sample
code&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#a9a9a9 size=1&gt;This sample is provided without any warranty. It's a sample,
so don't use it in production environments.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=bca19fa8-7ba8-43d8-873e-3a8cf03335cb" /&gt;</description>
      <comments>https://www.request-response.com/blog/CommentView,guid,bca19fa8-7ba8-43d8-873e-3a8cf03335cb.aspx</comments>
      <category>.NET 3.5 - WCF</category>
      <category>Transactions</category>
      <category>Web Services</category>
      <category>Windows Vista</category>
    </item>
    <item>
      <trackback:ping>https://www.request-response.com/blog/Trackback.aspx?guid=c421ff72-d5bc-4b5f-8c52-ed5e73e8dd00</trackback:ping>
      <pingback:server>https://www.request-response.com/blog/pingback.aspx</pingback:server>
      <pingback:target>https://www.request-response.com/blog/PermaLink,guid,c421ff72-d5bc-4b5f-8c52-ed5e73e8dd00.aspx</pingback:target>
      <dc:creator>Matevz Gacnik</dc:creator>
      <wfw:comment>https://www.request-response.com/blog/CommentView,guid,c421ff72-d5bc-4b5f-8c52-ed5e73e8dd00.aspx</wfw:comment>
      <wfw:commentRss>https://www.request-response.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=c421ff72-d5bc-4b5f-8c52-ed5e73e8dd00</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
If you happen to be on a Windows Vista or Windows Server 2008 box, there is some goodness
going your way.
</p>
        <p>
There is a basic managed <a href="http://msdn2.microsoft.com/En-US/library/aa365456.aspx">TxF</a> (Transactional
NTFS) wrapper available (unveiled by <a href="http://geekswithblogs.net/jolson/Default.aspx">Jason
Olson</a>).
</p>
        <p>
What this thing gives you is this:
</p>
        <p>
          <font face="Courier New">try<br />
{<br />
   using (TransactionScope tsFiles = new TransactionScope<br />
      </font>
          <font face="Courier New">TransactionScopeOption.RequiresNew))<br />
   {<br />
      WriteFile("TxFile1.txt");<br />
      <strong>throw new FileNotFoundException();<br /></strong>      WriteFile("TxFile2.txt");<br />
      tsFiles.Complete();<br />
   }<br />
}<br />
catch (Exception ex)<br />
{<br />
   Console.WriteLine(ex.Message);<br />
}</font>
        </p>
        <p>
          <font face="Courier New">WriteFile</font> method that does, well, file writing, is
here:
</p>
        <p>
          <font face="Courier New">using (TransactionScope tsFile = new TransactionScope<br />
      (TransactionScopeOption.Required))<br />
{<br />
   Console.WriteLine("Creating transacted file '{0}'.", filename);</font>
        </p>
        <p>
          <font face="Courier New">   using (StreamWriter tFile = new StreamWriter(TransactedFile.Open(filename, <br />
          FileMode.Create, 
<br />
          FileAccess.Write, 
<br />
          </font>
          <font face="Courier New">FileShare.None)))<br />
   {<br />
      tFile.Write(String.Format("Random data. My filename
is '{0}'.", 
<br />
          filename));<br />
   }</font>
        </p>
        <p>
          <font face="Courier New">   tsFile.Complete();<br />
   Console.WriteLine("File '{0}' written.", filename);<br />
}</font>
        </p>
        <p>
So we have a nested <font face="Courier New"><a href="http://msdn2.microsoft.com/en-us/library/system.transactions.transactionscope.aspx">TransactionScope</a></font> with
a curious type - <font face="Courier New">TransactedFile</font>. Mind you, there is
support for <font face="Courier New">TransactedDirectory</font> built in.
</p>
        <p>
What's happening underneath is awesome. The wrapper talks to unmanaged implementation
of TxF, which is built in on every Vista / Longhorn Server box. 
</p>
        <p>
What you get is transactional file system support with <a href="http://msdn2.microsoft.com/en-us/library/system.transactions.aspx">System.Transactions</a>.
And it's going to go far beyond that.
</p>
        <p>
I wrote some sample code, go get it. Oh, BTW, remove the exception line to see the
real benefit.
</p>
        <p>
Download: <a href="http://www.request-response.com/blog/content/binary/TxF_TransactedFile.zip">Sample
code</a></p>
        <p>
          <font color="#a9a9a9" size="1">This sample is provided without any warranty. It's
a sample, so don't use it in production environments.</font>
        </p>
        <img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=c421ff72-d5bc-4b5f-8c52-ed5e73e8dd00" />
      </body>
      <title>Managed TxF: Support in Windows Vista and Windows Server 2008</title>
      <guid isPermaLink="false">https://www.request-response.com/blog/PermaLink,guid,c421ff72-d5bc-4b5f-8c52-ed5e73e8dd00.aspx</guid>
      <link>https://www.request-response.com/blog/PermaLink,guid,c421ff72-d5bc-4b5f-8c52-ed5e73e8dd00.aspx</link>
      <pubDate>Fri, 20 Jul 2007 14:59:16 GMT</pubDate>
      <description>&lt;p&gt;
If you happen to be on a Windows Vista or Windows Server 2008 box, there is some goodness
going your way.
&lt;/p&gt;
&lt;p&gt;
There is a basic managed &lt;a href="http://msdn2.microsoft.com/En-US/library/aa365456.aspx"&gt;TxF&lt;/a&gt; (Transactional
NTFS) wrapper available (unveiled by&amp;nbsp;&lt;a href="http://geekswithblogs.net/jolson/Default.aspx"&gt;Jason
Olson&lt;/a&gt;).
&lt;/p&gt;
&lt;p&gt;
What this thing gives you is this:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;try&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp; using (TransactionScope tsFiles = new TransactionScope&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font face="Courier New"&gt;TransactionScopeOption.RequiresNew))&lt;br&gt;
&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WriteFile("TxFile1.txt");&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;throw new FileNotFoundException();&lt;br&gt;
&lt;/strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WriteFile("TxFile2.txt");&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tsFiles.Complete();&lt;br&gt;
&amp;nbsp;&amp;nbsp; }&lt;br&gt;
}&lt;br&gt;
catch (Exception ex)&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp; Console.WriteLine(ex.Message);&lt;br&gt;
}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;WriteFile&lt;/font&gt; method that does, well, file writing,&amp;nbsp;is
here:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;using (TransactionScope tsFile = new TransactionScope&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (TransactionScopeOption.Required))&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp; Console.WriteLine("Creating transacted file '{0}'.", filename);&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp; using (StreamWriter tFile = new StreamWriter(TransactedFile.Open(filename,&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FileMode.Create, 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileAccess.Write, 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font face="Courier New"&gt;FileShare.None)))&lt;br&gt;
&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tFile.Write(String.Format("Random data. My filename
is '{0}'.", 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename));&lt;br&gt;
&amp;nbsp;&amp;nbsp; }&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp; tsFile.Complete();&lt;br&gt;
&amp;nbsp;&amp;nbsp; Console.WriteLine("File '{0}' written.", filename);&lt;br&gt;
}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
So we have a nested &lt;font face="Courier New"&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.transactions.transactionscope.aspx"&gt;TransactionScope&lt;/a&gt;&lt;/font&gt; with
a curious type - &lt;font face="Courier New"&gt;TransactedFile&lt;/font&gt;. Mind you, there is
support for &lt;font face="Courier New"&gt;TransactedDirectory&lt;/font&gt; built in.
&lt;/p&gt;
&lt;p&gt;
What's happening underneath is awesome. The wrapper talks to unmanaged implementation
of TxF, which is built in on every Vista / Longhorn Server box. 
&lt;/p&gt;
&lt;p&gt;
What you get is transactional file system&amp;nbsp;support with &lt;a href="http://msdn2.microsoft.com/en-us/library/system.transactions.aspx"&gt;System.Transactions&lt;/a&gt;.
And it's going to go far beyond that.
&lt;/p&gt;
&lt;p&gt;
I wrote some sample code, go get it. Oh, BTW, remove the exception line to see the
real benefit.
&lt;/p&gt;
&lt;p&gt;
Download: &lt;a href="http://www.request-response.com/blog/content/binary/TxF_TransactedFile.zip"&gt;Sample
code&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#a9a9a9 size=1&gt;This sample is provided without any warranty. It's a sample,
so don't use it in production environments.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=c421ff72-d5bc-4b5f-8c52-ed5e73e8dd00" /&gt;</description>
      <comments>https://www.request-response.com/blog/CommentView,guid,c421ff72-d5bc-4b5f-8c52-ed5e73e8dd00.aspx</comments>
      <category>Transactions</category>
      <category>Windows Vista</category>
    </item>
    <item>
      <trackback:ping>https://www.request-response.com/blog/Trackback.aspx?guid=bdb761f8-8856-41c8-b4ad-c38338bf6567</trackback:ping>
      <pingback:server>https://www.request-response.com/blog/pingback.aspx</pingback:server>
      <pingback:target>https://www.request-response.com/blog/PermaLink,guid,bdb761f8-8856-41c8-b4ad-c38338bf6567.aspx</pingback:target>
      <dc:creator>Matevz Gacnik</dc:creator>
      <wfw:comment>https://www.request-response.com/blog/CommentView,guid,bdb761f8-8856-41c8-b4ad-c38338bf6567.aspx</wfw:comment>
      <wfw:commentRss>https://www.request-response.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=bdb761f8-8856-41c8-b4ad-c38338bf6567</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://blogs.msdn.com/nickmalik/archive/2007/05/30/system-reliability-requires-message-durability-immature-wcf.aspx">Nick</a> is
continuing <a href="http://www.request-response.com/blog/PermaLink,guid,03fb0e40-b446-42b5-ad90-3be9b0260cb5.aspx">my
discussion</a> on durable messaging support in modern WS-* based stacks, especially
WCF.
</p>
        <p>
I agree that having a simple channel configuration support to direct messages into
permanent information source (like SQL) would be <em>beneficial</em>.
</p>
        <p>
A simple idea that begs for an alternative implementation of a WCF extensibility
point, has some questions:
</p>
        <ul>
          <li>
What happens when messages are (or should be) exchanged in terms of a transaction
context? 
</li>
          <li>
How can we demand transaction support from the underlying datastore, if we don't want
to put limitations onto anything residing beind the service boundary? 
</li>
          <li>
What about security contexts? How can we acknowledge a secure, durable sessionful
channel after two weeks of service <strike>hibernation</strike> down time? Should
security keys still be valid just because service was down and not responding
all this time? 
</li>
          <li>
Is durability limited to client/service recycling or non-memory message storage? What
about both?</li>
        </ul>
        <p>
Is <font face="Courier New">[DurableService]</font>enough?
</p>
        <img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=bdb761f8-8856-41c8-b4ad-c38338bf6567" />
      </body>
      <title>Durable Messaging Continues</title>
      <guid isPermaLink="false">https://www.request-response.com/blog/PermaLink,guid,bdb761f8-8856-41c8-b4ad-c38338bf6567.aspx</guid>
      <link>https://www.request-response.com/blog/PermaLink,guid,bdb761f8-8856-41c8-b4ad-c38338bf6567.aspx</link>
      <pubDate>Wed, 30 May 2007 20:46:14 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://blogs.msdn.com/nickmalik/archive/2007/05/30/system-reliability-requires-message-durability-immature-wcf.aspx"&gt;Nick&lt;/a&gt; is
continuing &lt;a href="http://www.request-response.com/blog/PermaLink,guid,03fb0e40-b446-42b5-ad90-3be9b0260cb5.aspx"&gt;my
discussion&lt;/a&gt; on durable messaging support in modern WS-* based stacks, especially
WCF.
&lt;/p&gt;
&lt;p&gt;
I agree that having a simple channel configuration support to direct messages into
permanent information source (like SQL) would be &lt;em&gt;beneficial&lt;/em&gt;.
&lt;/p&gt;
&lt;p&gt;
A simple idea that begs for an alternative implementation of a WCF&amp;nbsp;extensibility
point, has some questions:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
What happens when messages are (or should be) exchanged in terms of a transaction
context? 
&lt;li&gt;
How can we demand transaction support from the underlying datastore, if we don't want
to put limitations onto anything residing beind the service boundary? 
&lt;li&gt;
What about security contexts? How can we acknowledge a secure, durable sessionful
channel after two weeks of service &lt;strike&gt;hibernation&lt;/strike&gt; down time? Should
security keys still be valid just&amp;nbsp;because service was down and not responding
all this time? 
&lt;li&gt;
Is durability limited to client/service recycling or non-memory message storage? What
about both?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Is&amp;nbsp;&lt;font face="Courier New"&gt;[DurableService]&lt;/font&gt;enough?
&lt;/p&gt;
&lt;img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=bdb761f8-8856-41c8-b4ad-c38338bf6567" /&gt;</description>
      <comments>https://www.request-response.com/blog/CommentView,guid,bdb761f8-8856-41c8-b4ad-c38338bf6567.aspx</comments>
      <category>.NET 3.5 - WCF</category>
      <category>Architecture</category>
      <category>Transactions</category>
      <category>Web Services</category>
    </item>
    <item>
      <trackback:ping>https://www.request-response.com/blog/Trackback.aspx?guid=970f2ea8-2c17-4ece-b80e-e131afdd9f5f</trackback:ping>
      <pingback:server>https://www.request-response.com/blog/pingback.aspx</pingback:server>
      <pingback:target>https://www.request-response.com/blog/PermaLink,guid,970f2ea8-2c17-4ece-b80e-e131afdd9f5f.aspx</pingback:target>
      <dc:creator>Matevz Gacnik</dc:creator>
      <wfw:comment>https://www.request-response.com/blog/CommentView,guid,970f2ea8-2c17-4ece-b80e-e131afdd9f5f.aspx</wfw:comment>
      <wfw:commentRss>https://www.request-response.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=970f2ea8-2c17-4ece-b80e-e131afdd9f5f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Third incarnation of the .NET 3.0 Middleware Technologies day went through yesterday.
</p>
        <p>
Here are the deliverables:
</p>
        <ul>
          <li>
PPT: <a href="http://www.request-response.com/blog/content/binary/WCF_WF_Feb2007_3.zip">Download</a> [1] 
</li>
          <li>
WCF Samples: <a href="http://www.request-response.com/blog/content/binary/WCFDemosFeb2007_3.zip">Download</a></li>
          <li>
WF Samples: <a href="http://www.request-response.com/blog/content/binary/WFDemosFeb2007_3.zip">Download</a></li>
        </ul>
        <p>
If you did not get/notice the printed articles, here's what should put you to sleep
over the weekend:
</p>
        <ul>
          <li>
            <a href="http://www.request-response.com/blog/PermaLink,guid,25e8d68b-09ff-46e8-b360-ecd5128aa90c.aspx">Concepts
and Semantics of Service Contracts</a> [1] 
</li>
          <li>
            <a href="http://www.request-response.com/blog/PermaLink,guid,a40bf4fb-fea6-42c5-a2f2-f0e7dafa3620.aspx">Transactional
Semantics in Loosely Coupled Distributed Systems</a> [1] 
</li>
          <li>
            <a href="http://www.request-response.com/blog/PermaLink,guid,86bd92f2-13fd-4454-ab88-272a4a8be875.aspx">Cooperation Between
Workflows and Services</a> [1] 
</li>
          <li>
            <a href="http://www.request-response.com/blog/PermaLink,guid,baaf6646-162a-4557-9d7e-10e4953ab627.aspx">Type
Systems Compared - XML &lt;&gt; CLR</a> [1]</li>
        </ul>
        <p>
Also, the accompanying book is available <a href="http://www.request-response.com/blog/PermaLink,guid,2f86ca0f-29fa-48b0-b761-ca147ada43dd.aspx">here</a>.
</p>
        <p>
          <font color="#808080" size="1">[1] Only available in Slovene.</font>
        </p>
        <img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=970f2ea8-2c17-4ece-b80e-e131afdd9f5f" />
      </body>
      <title>.NET 3.0 Middleware Technologies Day: Third Incarnation</title>
      <guid isPermaLink="false">https://www.request-response.com/blog/PermaLink,guid,970f2ea8-2c17-4ece-b80e-e131afdd9f5f.aspx</guid>
      <link>https://www.request-response.com/blog/PermaLink,guid,970f2ea8-2c17-4ece-b80e-e131afdd9f5f.aspx</link>
      <pubDate>Thu, 15 Feb 2007 05:09:56 GMT</pubDate>
      <description>&lt;p&gt;
Third incarnation of the .NET 3.0 Middleware Technologies day went through yesterday.
&lt;/p&gt;
&lt;p&gt;
Here are the deliverables:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
PPT: &lt;a href="http://www.request-response.com/blog/content/binary/WCF_WF_Feb2007_3.zip"&gt;Download&lt;/a&gt;&amp;nbsp;[1] 
&lt;li&gt;
WCF Samples: &lt;a href="http://www.request-response.com/blog/content/binary/WCFDemosFeb2007_3.zip"&gt;Download&lt;/a&gt; 
&lt;li&gt;
WF Samples: &lt;a href="http://www.request-response.com/blog/content/binary/WFDemosFeb2007_3.zip"&gt;Download&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
If you did not get/notice the printed articles, here's what should put you to sleep
over the weekend:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://www.request-response.com/blog/PermaLink,guid,25e8d68b-09ff-46e8-b360-ecd5128aa90c.aspx"&gt;Concepts
and Semantics of Service Contracts&lt;/a&gt;&amp;nbsp;[1] 
&lt;li&gt;
&lt;a href="http://www.request-response.com/blog/PermaLink,guid,a40bf4fb-fea6-42c5-a2f2-f0e7dafa3620.aspx"&gt;Transactional
Semantics in Loosely Coupled Distributed Systems&lt;/a&gt;&amp;nbsp;[1] 
&lt;li&gt;
&lt;a href="http://www.request-response.com/blog/PermaLink,guid,86bd92f2-13fd-4454-ab88-272a4a8be875.aspx"&gt;Cooperation&amp;nbsp;Between
Workflows and Services&lt;/a&gt;&amp;nbsp;[1] 
&lt;li&gt;
&lt;a href="http://www.request-response.com/blog/PermaLink,guid,baaf6646-162a-4557-9d7e-10e4953ab627.aspx"&gt;Type
Systems Compared - XML &amp;lt;&amp;gt; CLR&lt;/a&gt;&amp;nbsp;[1]&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Also, the accompanying book is available &lt;a href="http://www.request-response.com/blog/PermaLink,guid,2f86ca0f-29fa-48b0-b761-ca147ada43dd.aspx"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
&lt;font color=#808080 size=1&gt;[1] Only available in Slovene.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=970f2ea8-2c17-4ece-b80e-e131afdd9f5f" /&gt;</description>
      <comments>https://www.request-response.com/blog/CommentView,guid,970f2ea8-2c17-4ece-b80e-e131afdd9f5f.aspx</comments>
      <category>.NET 3.0 - General</category>
      <category>.NET 3.0 - WCF</category>
      <category>.NET 3.0 - WF</category>
      <category>Architecture</category>
      <category>Transactions</category>
    </item>
    <item>
      <trackback:ping>https://www.request-response.com/blog/Trackback.aspx?guid=a40bf4fb-fea6-42c5-a2f2-f0e7dafa3620</trackback:ping>
      <pingback:server>https://www.request-response.com/blog/pingback.aspx</pingback:server>
      <pingback:target>https://www.request-response.com/blog/PermaLink,guid,a40bf4fb-fea6-42c5-a2f2-f0e7dafa3620.aspx</pingback:target>
      <dc:creator>Matevz Gacnik</dc:creator>
      <wfw:comment>https://www.request-response.com/blog/CommentView,guid,a40bf4fb-fea6-42c5-a2f2-f0e7dafa3620.aspx</wfw:comment>
      <wfw:commentRss>https://www.request-response.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=a40bf4fb-fea6-42c5-a2f2-f0e7dafa3620</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://www.request-response.com/blog/PermaLink,guid,e77d7831-b76f-4750-a650-1503b425467e.aspx">Last
article</a> finished my XML series. This one focuses on transactional semantics in
a service oriented universe.
</p>
        <p>
Language: <strong><em>Slovenian</em></strong></p>
        <hr />
        <p>
Naslov:
</p>
        <p>
          <a href="http://www.request-response.com/blog/content/binary/MatevzGacnik-TransactionalServices.doc">Transakcijska
semantika v šibko sklopljenih, porazdeljenih sistemih</a>
        </p>
        <p>
          <em>
            <a href="http://www.request-response.com/blog/content/binary/MatevzGacnik-TransactionalServices.doc">
              <img alt="Transakcijska semantika v šibko sklopljenih, porazdeljenih sistemih" hspace="0" src="http://www.request-response.com/blog/images/matevzgacnik-TransactionalServices.jpg" align="baseline" border="1" />
            </a>
          </em>
        </p>
        <img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=a40bf4fb-fea6-42c5-a2f2-f0e7dafa3620" />
      </body>
      <title>Article: Transactional Semantics in Loosely Coupled Distributed Systems</title>
      <guid isPermaLink="false">https://www.request-response.com/blog/PermaLink,guid,a40bf4fb-fea6-42c5-a2f2-f0e7dafa3620.aspx</guid>
      <link>https://www.request-response.com/blog/PermaLink,guid,a40bf4fb-fea6-42c5-a2f2-f0e7dafa3620.aspx</link>
      <pubDate>Tue, 06 Jun 2006 08:59:30 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://www.request-response.com/blog/PermaLink,guid,e77d7831-b76f-4750-a650-1503b425467e.aspx"&gt;Last
article&lt;/a&gt; finished my XML series. This one focuses on transactional semantics in
a service oriented universe.
&lt;/p&gt;
&lt;p&gt;
Language:&amp;nbsp;&lt;strong&gt;&lt;em&gt;Slovenian&lt;/em&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;
Naslov:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.request-response.com/blog/content/binary/MatevzGacnik-TransactionalServices.doc"&gt;Transakcijska
semantika v šibko sklopljenih, porazdeljenih sistemih&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;a href="http://www.request-response.com/blog/content/binary/MatevzGacnik-TransactionalServices.doc"&gt;&lt;img alt="Transakcijska semantika v šibko sklopljenih, porazdeljenih sistemih" hspace=0 src="http://www.request-response.com/blog/images/matevzgacnik-TransactionalServices.jpg" align=baseline border=1&gt;&lt;/a&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=a40bf4fb-fea6-42c5-a2f2-f0e7dafa3620" /&gt;</description>
      <comments>https://www.request-response.com/blog/CommentView,guid,a40bf4fb-fea6-42c5-a2f2-f0e7dafa3620.aspx</comments>
      <category>.NET 3.0 - WCF</category>
      <category>Architecture</category>
      <category>Articles</category>
      <category>Transactions</category>
      <category>Web Services</category>
    </item>
    <item>
      <trackback:ping>https://www.request-response.com/blog/Trackback.aspx?guid=9b13af92-743c-41da-bfab-e90410b27650</trackback:ping>
      <pingback:server>https://www.request-response.com/blog/pingback.aspx</pingback:server>
      <pingback:target>https://www.request-response.com/blog/PermaLink,guid,9b13af92-743c-41da-bfab-e90410b27650.aspx</pingback:target>
      <dc:creator>Matevz Gacnik</dc:creator>
      <wfw:comment>https://www.request-response.com/blog/CommentView,guid,9b13af92-743c-41da-bfab-e90410b27650.aspx</wfw:comment>
      <wfw:commentRss>https://www.request-response.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=9b13af92-743c-41da-bfab-e90410b27650</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The following is a list of Windows Communication Foundation (read Indigo) changes
from September CTP (beta 1) to November CTP (beta 2 RC0).
</p>
        <p>
Most of them are name changes. Nevertheless, you will need to update at least configuration,
since element/attribute naming there has changed quite a lot.
</p>
        <p>
Class name changes:
</p>
        <ol>
          <li>
            <font face="Courier New">Fault&lt;T&gt;       FaultException&lt;T&gt;</font>
          </li>
          <li>
            <font face="Courier New">UnknownFault   UnknownFaultException</font>
          </li>
          <li>
            <font face="Courier New">ServiceSite    InstanceContext</font>
          </li>
        </ol>
        <p>
Parameters of [OperationBehaviour] attribute:
</p>
        <ol>
          <li>
            <font face="Courier New">AutoCompleteTransaction TransactionAutoComplete</font>
          </li>
          <li>
            <font face="Courier New">AutoEnlistTransaction   TransactionScopeRequired</font>
          </li>
        </ol>
        <p>
Other changes:
</p>
        <ol>
          <li>
            <font face="Courier New">ServiceHost&lt;T&gt;   ServiceHost(typeof(T)&gt;</font>
          </li>
        </ol>
        <p>
Binding names:
</p>
        <ol>
          <li>
            <font face="Courier New">wsProfileBinding           
wsHttpBinding</font>
          </li>
          <li>
            <font face="Courier New">netProfileTcpBinding       
netTcpBinding</font>
          </li>
          <li>
            <font face="Courier New">netProfileDualTcpBinding    netTcpBinding</font>
          </li>
          <li>
            <font face="Courier New">netProfileNamedPipeBinding  netNamedPipeBinding</font>
          </li>
          <li>
            <font face="Courier New">basicProfileBinding        
basicHttpBinding</font>
          </li>
        </ol>
        <p>
Configuration element/attribute name changes:
</p>
        <ol>
          <li>
            <font face="Courier New">/services/service[@serviceType]                  
/services/service[@type]</font>
          </li>
          <li>
            <font face="Courier New">/endpoints/endpoint[@contractType]               
/endpoints/endpoint[@contact]</font>
          </li>
          <li>
            <font face="Courier New">/services/service/endpoint[@bindingSectionName]   /services/service/endpoint[@binding]</font>
          </li>
          <li>
            <font face="Courier New">/behaviors/behavior[@configurationName]          
/behaviors/behavior[@name]</font>
          </li>
          <li>
            <font face="Courier New">/bindings/*/binding[@configurationName]          
/bindings/*/binding[@name]</font>
          </li>
        </ol>
        <p>
Attribute changes:
</p>
        <ol>
          <li>
            <font face="Courier New">[BindingRequirements(TransactionFlowRequirements=RequirementsMode.Require)]<br />
[TransactionFlow(TransactionFlowOption.Required)] </font>
          </li>
          <li>
            <font face="Courier New">[BindingRequirements(QueuedDeliveryRequirements=RequirementsMode.Require)<br />
[BindingRequirements(QueuedDeliveryRequirements=BindingRequirementsMode.Required)</font>
          </li>
          <li>
            <font face="Courier New">[InstanceMode=InstanceMode.Singleton]<br />
[InstanceContextMode=InstanceContextMode.Single]</font>
          </li>
          <li>
            <font face="Courier New">[InstanceMode=InstanceMode.PrivateSession]<br />
[InstanceContextMode=InstanceContextMode.PerSession]</font>
          </li>
          <li>
            <font face="Courier New">[InstanceMode=InstanceMode.PerCall]<br />
[InstanceContextMode=InstanceContextMode.PerCall]</font>
          </li>
          <li>
            <font face="Courier New">[InstanceMode=InstanceMode.SharedSession]<br />
[InstanceContextMode=InstanceContextMode.Shared]</font>
          </li>
        </ol>
        <p>
This list may not be complete.
</p>
        <p>
I do expect that <font face="Courier New">QueuedDeliveryRequirements</font> property
of <font face="Courier New">[BindingRequirements]</font> attribute will be standalone
when Indigo ships. There's no point in having a separate attribute for expected transaction
semantics and leave out the queued delivery. It's the same concept being pushed down
to administrators (binding requirements are fixed requirements which are supposed
to be met by the admin - they are the developers' law of expected processing model).
</p>
        <p>
Maybe this attribute should be named <font face="Courier New">[QueuedDelivery]</font>,
with appropriate property for demanding it (like <font face="Courier New">QueuedDeliveryOption</font>)
and a property called <font face="Courier New">OrderedSessionOption</font>, which
would handle ordered session maintenance.
</p>
        <img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=9b13af92-743c-41da-bfab-e90410b27650" />
      </body>
      <title>WCF - List of Changes from Beta 1 to Beta 2 RC0</title>
      <guid isPermaLink="false">https://www.request-response.com/blog/PermaLink,guid,9b13af92-743c-41da-bfab-e90410b27650.aspx</guid>
      <link>https://www.request-response.com/blog/PermaLink,guid,9b13af92-743c-41da-bfab-e90410b27650.aspx</link>
      <pubDate>Sun, 11 Dec 2005 19:12:52 GMT</pubDate>
      <description>&lt;p&gt;
The following is a list of Windows Communication Foundation (read Indigo) changes
from September CTP (beta 1)&amp;nbsp;to November CTP (beta 2 RC0).
&lt;/p&gt;
&lt;p&gt;
Most of them are name changes. Nevertheless, you will need to update at least configuration,
since element/attribute naming there has changed quite a lot.
&lt;/p&gt;
&lt;p&gt;
Class name changes:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;font face="Courier New"&gt;Fault&amp;lt;T&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FaultException&amp;lt;T&amp;gt;&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;UnknownFault&amp;nbsp;&amp;nbsp;&amp;nbsp;UnknownFaultException&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;ServiceSite&amp;nbsp;&amp;nbsp;&amp;nbsp; InstanceContext&lt;/font&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Parameters of [OperationBehaviour] attribute:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;font face="Courier New"&gt;AutoCompleteTransaction TransactionAutoComplete&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;AutoEnlistTransaction&amp;nbsp;&amp;nbsp;&amp;nbsp;TransactionScopeRequired&lt;/font&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Other changes:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;font face="Courier New"&gt;ServiceHost&amp;lt;T&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ServiceHost(typeof(T)&amp;gt;&lt;/font&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Binding names:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;font face="Courier New"&gt;wsProfileBinding&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
wsHttpBinding&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;netProfileTcpBinding&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
netTcpBinding&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;netProfileDualTcpBinding&amp;nbsp;&amp;nbsp;&amp;nbsp; netTcpBinding&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;netProfileNamedPipeBinding&amp;nbsp; netNamedPipeBinding&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;basicProfileBinding&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
basicHttpBinding&lt;/font&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Configuration element/attribute name changes:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;font face="Courier New"&gt;/services/service[@serviceType]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
/services/service[@type]&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;/endpoints/endpoint[@contractType]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
/endpoints/endpoint[@contact]&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;/services/service/endpoint[@bindingSectionName]&amp;nbsp;&amp;nbsp;&amp;nbsp;/services/service/endpoint[@binding]&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;/behaviors/behavior[@configurationName]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
/behaviors/behavior[@name]&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;/bindings/*/binding[@configurationName]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
/bindings/*/binding[@name]&lt;/font&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Attribute changes:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;font face="Courier New"&gt;[BindingRequirements(TransactionFlowRequirements=RequirementsMode.Require)]&lt;br&gt;
[TransactionFlow(TransactionFlowOption.Required)]&amp;nbsp;&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;[BindingRequirements(QueuedDeliveryRequirements=RequirementsMode.Require)&lt;br&gt;
[BindingRequirements(QueuedDeliveryRequirements=BindingRequirementsMode.Required)&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;[InstanceMode=InstanceMode.Singleton]&lt;br&gt;
[InstanceContextMode=InstanceContextMode.Single]&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;[InstanceMode=InstanceMode.PrivateSession]&lt;br&gt;
[InstanceContextMode=InstanceContextMode.PerSession]&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;[InstanceMode=InstanceMode.PerCall]&lt;br&gt;
[InstanceContextMode=InstanceContextMode.PerCall]&lt;/font&gt; 
&lt;li&gt;
&lt;font face="Courier New"&gt;[InstanceMode=InstanceMode.SharedSession]&lt;br&gt;
[InstanceContextMode=InstanceContextMode.Shared]&lt;/font&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
This list may not be complete.
&lt;/p&gt;
&lt;p&gt;
I do expect that &lt;font face="Courier New"&gt;QueuedDeliveryRequirements&lt;/font&gt; property
of &lt;font face="Courier New"&gt;[BindingRequirements]&lt;/font&gt; attribute will be standalone
when Indigo ships. There's no point in having a separate attribute for expected transaction
semantics and leave out the queued delivery. It's the same concept being pushed down
to administrators (binding requirements are fixed requirements which are supposed
to be met by the admin - they are the developers' law of expected processing model).
&lt;/p&gt;
&lt;p&gt;
Maybe this attribute should be named &lt;font face="Courier New"&gt;[QueuedDelivery]&lt;/font&gt;,
with appropriate property for demanding it (like &lt;font face="Courier New"&gt;QueuedDeliveryOption&lt;/font&gt;)
and a property called &lt;font face="Courier New"&gt;OrderedSessionOption&lt;/font&gt;, which
would handle ordered session maintenance.
&lt;/p&gt;
&lt;img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=9b13af92-743c-41da-bfab-e90410b27650" /&gt;</description>
      <comments>https://www.request-response.com/blog/CommentView,guid,9b13af92-743c-41da-bfab-e90410b27650.aspx</comments>
      <category>.NET 3.0 - WCF</category>
      <category>Transactions</category>
    </item>
    <item>
      <trackback:ping>https://www.request-response.com/blog/Trackback.aspx?guid=5371ff94-3412-4e41-87f7-3740c8e04ac4</trackback:ping>
      <pingback:server>https://www.request-response.com/blog/pingback.aspx</pingback:server>
      <pingback:target>https://www.request-response.com/blog/PermaLink,guid,5371ff94-3412-4e41-87f7-3740c8e04ac4.aspx</pingback:target>
      <dc:creator>Matevz Gacnik</dc:creator>
      <wfw:comment>https://www.request-response.com/blog/CommentView,guid,5371ff94-3412-4e41-87f7-3740c8e04ac4.aspx</wfw:comment>
      <wfw:commentRss>https://www.request-response.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=5371ff94-3412-4e41-87f7-3740c8e04ac4</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
There is a common functionality request in modern distributed applications that clients
and services (client also being other services) could communicate using different
communication protocols and/or different transport semantics inside a single protocol.
</p>
        <p>
For this sample we're going to limit ourselves to HTTP messaging, but this does not
limit the scope of the article. Other transport protocols can be added without obstructing
other transport mechanisms.
</p>
        <p>
To allow this scenario Indigo (Windows Communication Foundation, WCF) allows multiple
endpoints per service to be setup. Service side bindings can, for example, be the
following:
</p>
        <p>
          <font face="Courier New">&lt;bindings&gt;<br />
  &lt;wsProfileBinding&gt;<br />
    &lt;binding 
<br />
      configurationName="Secure" 
<br />
      orderedSession="false" 
<br />
      reliableSessionEnabled="false" 
<br />
      securityMode="WSSecurityOverHttp" 
<br />
      maxMessageSize="134217728"<br />
      flowTransactions="NotAllowed"<br />
      messageEncoding="Text"&gt;<br />
      &lt;wsSecurity 
<br />
        authenticationMode="Certificate" 
<br />
        useNegotiation="true" /&gt;<br />
    &lt;/binding&gt;<br />
    &lt;binding 
<br />
      configurationName="SecureReliable" 
<br />
      orderedSession="true" 
<br />
      reliableSessionEnabled="true" 
<br />
      securityMode="WSSecurityOverHttp"<br />
      maxMessageSize="134217728"<br />
      flowTransactions="NotAllowed"<br />
      messageEncoding="Text"&gt;<br />
      &lt;wsSecurity<br />
        authenticationMode="Certificate" 
<br />
        useNegotiation="true" /&gt;<br />
    &lt;/binding&gt;<br />
    &lt;binding<br />
      configurationName="SecureReliableTransacted" 
<br />
      orderedSession="true" 
<br />
      reliableSessionEnabled="true" 
<br />
      securityMode="WSSecurityOverHttp"<br />
      maxMessageSize="134217728"<br />
      flowTransactions="Allowed"<br />
      messageEncoding="Text"&gt;<br />
      &lt;wsSecurity 
<br />
        authenticationMode="Certificate" 
<br />
        useNegotiation="true" /&gt;<br />
    &lt;/binding&gt;<br />
    &lt;binding 
<br />
      configurationName="SecureMTOM" 
<br />
      orderedSession="false" 
<br />
      reliableSessionEnabled="false" 
<br />
      securityMode="WSSecurityOverHttp" 
<br />
      maxMessageSize="134217728"<br />
      flowTransactions="NotAllowed"<br />
      messageEncoding="Mtom"&gt;<br />
      &lt;wsSecurity 
<br />
        authenticationMode="Certificate" 
<br />
        useNegotiation="true" /&gt;<br />
    &lt;/binding&gt;<br />
    &lt;binding 
<br />
      configurationName="SecureReliableMTOM" 
<br />
      orderedSession="true" 
<br />
      reliableSessionEnabled="true" 
<br />
      securityMode="WSSecurityOverHttp"<br />
      maxMessageSize="134217728"<br />
      flowTransactions="NotAllowed"<br />
      messageEncoding="Mtom"&gt;<br />
      &lt;wsSecurity 
<br />
        authenticationMode="Certificate" 
<br />
        useNegotiation="true" /&gt;<br />
    &lt;/binding&gt;<br />
   &lt;binding<br />
      configurationName="SecureReliableTransactedMTOM" 
<br />
      orderedSession="true" 
<br />
      reliableSessionEnabled="true" 
<br />
      securityMode="WSSecurityOverHttp"<br />
      maxMessageSize="134217728"<br />
      flowTransactions="Allowed"<br />
      messageEncoding="Mtom"&gt;<br />
      &lt;wsSecurity 
<br />
        authenticationMode="Certificate" 
<br />
        useNegotiation="true" /&gt;<br />
    &lt;/binding&gt;<br />
  &lt;/wsProfileBinding&gt;<br />
&lt;/bindings&gt;</font>
        </p>
        <p>
There are six different bindings setup:
</p>
        <ul>
          <li>
Secure 
</li>
          <li>
SecureReliable 
</li>
          <li>
SecureReliableTransacted 
</li>
          <li>
SecureMTOM 
</li>
          <li>
SecureReliableMTOM 
</li>
          <li>
SecureReliableTransactedMTOM</li>
        </ul>
        <p>
The <font face="Courier New">Secure</font> binding uses WS-Security/WS-SecureConversation
pair to secure all outgoing and incoming messages using encryption and digital signing.
We’re not going to drill down into it in this post. I’m going to write another one
where different certificate mechanisms will be discussed.
</p>
        <p>
The <font face="Courier New">SecureReliable</font> binding also uses WS-ReliableMessaging
with message ordering and guaranteed delivery turned on.
</p>
        <p>
The <font face="Courier New">SecureReliableTransacted</font> endpoint also uses WS-AtomicTransaction
to implement transaction semantics between the client and the service.<br />
There are another three bindings (<font face="Courier New">*MTOM</font>) with the
same transport semantics as well as MTOM encoding turned on. Since services can support
transfer of large binary files, we have also set the <font face="Courier New">maxMessageSize</font> attribute
in every binding to 128 MB.
</p>
        <p>
Endpoint configuration for this service is:
</p>
        <p>
          <font face="Courier New">&lt;services&gt;<br />
  &lt;service<br />
    serviceType="Indigo.Demos.TransferService"<br />
    behaviorConfiguration="DefaultBehavior"&gt;<br />
    &lt;endpoint 
<br />
      address="</font>
          <a href="http://localhost:666/TransferService.svc/">
            <font face="Courier New">http://localhost:666/TransferService.svc/</font>
          </a>
          <font face="Courier New">" 
<br />
      bindingNamespace=<br />
        "</font>
          <a href="http://webservices.gama-system.com/bindings">
            <font face="Courier New">http://webservices.gama-system.com/bindings</font>
          </a>
          <font face="Courier New">" 
<br />
      bindingName="Default" 
<br />
      bindingSectionName="wsProfileBinding" 
<br />
      bindingConfiguration="SecureReliableMTOM" 
<br />
      contractType="Indigo.Demos.ITransferContract"/&gt;<br />
    &lt;endpoint 
<br />
      address=<br />
        "</font>
          <a href="http://localhost:666/TransferService.svc/secure">
            <font face="Courier New">http://localhost:666/TransferService.svc/secure</font>
          </a>
          <font face="Courier New">"<br />
      bindingNamespace=<br />
        "</font>
          <a href="http://webservices.gama-system.com/bindings">
            <font face="Courier New">http://webservices.gama-system.com/bindings</font>
          </a>
          <font face="Courier New">" 
<br />
      bindingName="Secure" 
<br />
      bindingSectionName="wsProfileBinding" 
<br />
      bindingConfiguration="Secure" 
<br />
      contractType="Indigo.Demos.ITransferContract"/&gt;<br />
    &lt;endpoint 
<br />
      address=<br />
        "</font>
          <a href="http://localhost:666/TransferService.svc/">
            <font face="Courier New">http://localhost:666/TransferService.svc/</font>
          </a>
          <br />
          <font face="Courier New">        securereliable" 
<br />
      bindingNamespace=<br />
        "</font>
          <a href="http://webservices.gama-system.com/bindings">
            <font face="Courier New">http://webservices.gama-system.com/bindings</font>
          </a>
          <font face="Courier New">" 
<br />
      bindingName="SecureReliable" 
<br />
      bindingSectionName="wsProfileBinding" 
<br />
      bindingConfiguration="SecureReliable" 
<br />
      contractType="Indigo.Demos.ITransferContract"/&gt;<br />
    &lt;endpoint 
<br />
      address=<br />
        "</font>
          <a href="http://localhost:666/TransferService.svc/">
            <font face="Courier New">http://localhost:666/TransferService.svc/</font>
          </a>
          <br />
          <font face="Courier New">          securereliabletransacted" 
<br />
      bindingNamespace=<br />
        "</font>
          <a href="http://webservices.gama-system.com/bindings">
            <font face="Courier New">http://webservices.gama-system.com/bindings</font>
          </a>
          <font face="Courier New">" 
<br />
      bindingName="SecureReliableTransacted" 
<br />
      bindingSectionName="wsProfileBinding" 
<br />
      bindingConfiguration="SecureReliableTransacted" 
<br />
      contractType="Indigo.Demos.ITransferContract"/&gt;<br />
    &lt;endpoint 
<br />
      address=<br />
        "</font>
          <a href="http://localhost:666/TransferService.svc/">
            <font face="Courier New">http://localhost:666/TransferService.svc/</font>
          </a>
          <br />
          <font face="Courier New">          secureMTOM" 
<br />
      bindingNamespace=<br />
        "</font>
          <a href="http://webservices.gama-system.com/bindings">
            <font face="Courier New">http://webservices.gama-system.com/bindings</font>
          </a>
          <font face="Courier New">" 
<br />
      bindingName="SecureMTOM" 
<br />
      bindingSectionName="wsProfileBinding" 
<br />
      bindingConfiguration="SecureMTOM" 
<br />
      contractType="Indigo.Demos.ITransferContract"/&gt;<br />
    &lt;endpoint 
<br />
      address=<br />
      "</font>
          <a href="http://localhost:666/TransferService.svc/">
            <font face="Courier New">http://localhost:666/TransferService.svc/</font>
          </a>
          <br />
          <font face="Courier New">        securereliableMTOM" 
<br />
      bindingNamespace=<br />
       "</font>
          <a href="http://webservices.gama-system.com/bindings">
            <font face="Courier New">http://webservices.gama-system.com/bindings</font>
          </a>
          <font face="Courier New">" 
<br />
      bindingName="SecureReliableMTOM" 
<br />
      bindingSectionName="wsProfileBinding" 
<br />
      bindingConfiguration="SecureReliableMTOM" 
<br />
      contractType="Indigo.Demos.ITransferContract"/&gt;<br />
    &lt;endpoint 
<br />
      address=<br />
        "</font>
          <a href="http://localhost:666/TransferService.svc/">
            <font face="Courier New">http://localhost:666/TransferService.svc/</font>
          </a>
          <br />
          <font face="Courier New">          securereliabletransactedMTOM" 
<br />
      bindingNamespace=<br />
        "</font>
          <a href="http://webservices.gama-system.com/bindings">
            <font face="Courier New">http://webservices.gama-system.com/bindings</font>
          </a>
          <font face="Courier New">" 
<br />
      bindingName="SecureReliableTransactedMTOM" 
<br />
      bindingSectionName="wsProfileBinding" 
<br />
      bindingConfiguration="SecureReliableTransactedMTOM" 
<br />
      contractType="Indigo.Demos.ITransferContract"/&gt;<br />
  &lt;/service&gt;<br />
&lt;/services&gt;</font>
        </p>
        <p>
It can be seen that almost every endpoint (two are bound to the same binding) is bound
to a different binding.<br />
The service is therefore exposing its functionality using the following endpoints:
</p>
        <ul>
          <li>
            <a href="http://localhost:666/TransferService.svc/">
              <font face="Courier New">http://localhost:666/TransferService.svc/</font>
            </a>
          </li>
          <li>
            <a href="http://localhost:666/TransferService.svc/secure">
              <font face="Courier New">http://localhost:666/TransferService.svc/secure</font>
            </a>
          </li>
          <li>
            <a href="http://localhost:666/TransferService.svc/securereliable">
              <font face="Courier New">http://localhost:666/TransferService.svc/securereliable</font>
            </a>
          </li>
          <li>
            <a href="http://localhost:666/TransferService.svc/securereliabletransacted">
              <font face="Courier New">http://localhost:666/TransferService.svc/securereliabletransacted</font>
            </a>
          </li>
          <li>
            <a href="http://localhost:666/TransferService.svc/secureMTOM">
              <font face="Courier New">http://localhost:666/TransferService.svc/secureMTOM</font>
            </a>
          </li>
          <li>
            <a href="http://localhost:666/TransferService.svc/securereliableMTOM">
              <font face="Courier New">http://localhost:666/TransferService.svc/securereliableMTOM</font>
            </a>
          </li>
          <li>
            <a href="http://localhost:666/TransferService.svc/securereliabletransactedMTOM">
              <font face="Courier New">http://localhost:666/TransferService.svc/securereliabletransactedMTOM</font>
            </a>
          </li>
        </ul>
        <p>
The first endpoint in this example is considered a default one and is mapped to the
same binding as the <font face="Courier New">*securereliableMTOM</font> endpoint.
</p>
        <p>
The problem with this is that current WCF’s WSDLExporter maps different endpoints
into WSDL ports, but WSDL ports have a requirement to be uniquely named. The default
port name construction is done by using the binding type name (i.e. <font face="Courier New">wsProfileBinding</font>, <font face="Courier New">basicProfileBinding</font>),
which is concatenated with the contract name.
</p>
        <p>
Therefore, when one has defined multiple bindings from the same binding type a name
collision occurs (six WSDL ports with the same QName (namespace and local name)).
This can be avoided using a <font face="Courier New">bindingNamespace</font> attribute
as well as <font face="Courier New">bindingName</font> attribute. In this example
we set the <font face="Courier New">bindingNamespace</font> to <a href="http://webservices.gama-system.com/bindings">http://webservices.gama-system.com/bindings</a> for
all bindings and made the name unique by using the bindingName attribute.
</p>
        <p>
There are currently two weird design decisions in multiple binding support of WCF.
First <font face="Courier New">bindingNamespace</font> and <font face="Courier New">bindingName</font> attributes
are bound to endpoints and not bindings. It would probably be more appropriate to
put binding’s namespace and name into the <font face="Courier New">&lt;binding&gt;</font> element.
Second, binding name is not propagated into WSDL properly when the same binding is
used in two or more endpoints (in this example <a href="http://localhost:666/TransferService.svc/">http://localhost:666/TransferService.svc/</a> and <a href="http://localhost:666/TransferService.svc/securereliableMTOM">http://localhost:666/TransferService.svc/securereliableMTOM</a> endpoints
are bound to <font face="Courier New">Default</font> binding. If you look closely
into the generated WSDL, you will see that the matching WSDL ports are not named after <font face="Courier New">bindingName</font> attribute.
</p>
        <p>
These are non-breaking issues and will probably be addressed for beta 2 of WCF.
</p>
        <p>
In the next Indigo series post, we’ll look closely into the security characteristics
of certificate based authentication.
</p>
        <img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=5371ff94-3412-4e41-87f7-3740c8e04ac4" />
      </body>
      <title>Indigo - Multiple endpoints</title>
      <guid isPermaLink="false">https://www.request-response.com/blog/PermaLink,guid,5371ff94-3412-4e41-87f7-3740c8e04ac4.aspx</guid>
      <link>https://www.request-response.com/blog/PermaLink,guid,5371ff94-3412-4e41-87f7-3740c8e04ac4.aspx</link>
      <pubDate>Fri, 12 Aug 2005 11:02:47 GMT</pubDate>
      <description>&lt;p&gt;
There is a common functionality request in modern distributed applications that clients
and services (client also being other services) could communicate using different
communication protocols and/or different transport semantics inside a single protocol.
&lt;/p&gt;
&lt;p&gt;
For this sample we're going to limit ourselves to HTTP messaging, but this does not
limit the scope of the article. Other transport protocols can be added without obstructing
other transport mechanisms.
&lt;/p&gt;
&lt;p&gt;
To allow this scenario Indigo (Windows Communication Foundation, WCF) allows multiple
endpoints per service to be setup. Service side bindings can, for example, be the
following:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;lt;bindings&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;wsProfileBinding&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;binding 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; configurationName="Secure" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; orderedSession="false" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reliableSessionEnabled="false" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; securityMode="WSSecurityOverHttp" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxMessageSize="134217728"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flowTransactions="NotAllowed"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; messageEncoding="Text"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;wsSecurity 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; authenticationMode="Certificate" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; useNegotiation="true" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/binding&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;binding 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; configurationName="SecureReliable" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; orderedSession="true" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reliableSessionEnabled="true" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; securityMode="WSSecurityOverHttp"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxMessageSize="134217728"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flowTransactions="NotAllowed"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; messageEncoding="Text"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;wsSecurity&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; authenticationMode="Certificate" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; useNegotiation="true" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/binding&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;binding&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; configurationName="SecureReliableTransacted" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; orderedSession="true" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reliableSessionEnabled="true" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; securityMode="WSSecurityOverHttp"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxMessageSize="134217728"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flowTransactions="Allowed"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; messageEncoding="Text"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;wsSecurity 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; authenticationMode="Certificate" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; useNegotiation="true" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/binding&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;binding 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; configurationName="SecureMTOM" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; orderedSession="false" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reliableSessionEnabled="false" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; securityMode="WSSecurityOverHttp" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxMessageSize="134217728"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flowTransactions="NotAllowed"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; messageEncoding="Mtom"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;wsSecurity 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; authenticationMode="Certificate" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; useNegotiation="true" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/binding&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;binding 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; configurationName="SecureReliableMTOM" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; orderedSession="true" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reliableSessionEnabled="true" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; securityMode="WSSecurityOverHttp"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxMessageSize="134217728"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flowTransactions="NotAllowed"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; messageEncoding="Mtom"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;wsSecurity 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; authenticationMode="Certificate" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; useNegotiation="true" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/binding&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;binding&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; configurationName="SecureReliableTransactedMTOM" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; orderedSession="true" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reliableSessionEnabled="true" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; securityMode="WSSecurityOverHttp"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxMessageSize="134217728"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flowTransactions="Allowed"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; messageEncoding="Mtom"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;wsSecurity 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; authenticationMode="Certificate" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; useNegotiation="true" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/binding&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/wsProfileBinding&amp;gt;&lt;br&gt;
&amp;lt;/bindings&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
There are six different bindings setup:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Secure 
&lt;li&gt;
SecureReliable 
&lt;li&gt;
SecureReliableTransacted 
&lt;li&gt;
SecureMTOM 
&lt;li&gt;
SecureReliableMTOM 
&lt;li&gt;
SecureReliableTransactedMTOM&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
The &lt;font face="Courier New"&gt;Secure&lt;/font&gt; binding uses WS-Security/WS-SecureConversation
pair to secure all outgoing and incoming messages using encryption and digital signing.
We’re not going to drill down into it in this post. I’m going to write another one
where different certificate mechanisms will be discussed.
&lt;/p&gt;
&lt;p&gt;
The &lt;font face="Courier New"&gt;SecureReliable&lt;/font&gt; binding also uses WS-ReliableMessaging
with message ordering and guaranteed delivery turned on.
&lt;/p&gt;
&lt;p&gt;
The &lt;font face="Courier New"&gt;SecureReliableTransacted&lt;/font&gt; endpoint also uses WS-AtomicTransaction
to implement transaction semantics between the client and the service.&lt;br&gt;
There are another three bindings (&lt;font face="Courier New"&gt;*MTOM&lt;/font&gt;) with the
same transport semantics as well as MTOM encoding turned on. Since services can support
transfer of large binary files, we have also set the &lt;font face="Courier New"&gt;maxMessageSize&lt;/font&gt; attribute
in every binding to 128 MB.
&lt;/p&gt;
&lt;p&gt;
Endpoint configuration for this service is:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;lt;services&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;service&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; serviceType="Indigo.Demos.TransferService"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; behaviorConfiguration="DefaultBehavior"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpoint 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; address="&lt;/font&gt;&lt;a href="http://localhost:666/TransferService.svc/"&gt;&lt;font face="Courier New"&gt;http://localhost:666/TransferService.svc/&lt;/font&gt;&lt;/a&gt;&lt;font face="Courier New"&gt;" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingNamespace=&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/font&gt;&lt;a href="http://webservices.gama-system.com/bindings"&gt;&lt;font face="Courier New"&gt;http://webservices.gama-system.com/bindings&lt;/font&gt;&lt;/a&gt;&lt;font face="Courier New"&gt;" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingName="Default" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingSectionName="wsProfileBinding" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingConfiguration="SecureReliableMTOM" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contractType="Indigo.Demos.ITransferContract"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpoint 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; address=&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/font&gt;&lt;a href="http://localhost:666/TransferService.svc/secure"&gt;&lt;font face="Courier New"&gt;http://localhost:666/TransferService.svc/secure&lt;/font&gt;&lt;/a&gt;&lt;font face="Courier New"&gt;"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingNamespace=&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/font&gt;&lt;a href="http://webservices.gama-system.com/bindings"&gt;&lt;font face="Courier New"&gt;http://webservices.gama-system.com/bindings&lt;/font&gt;&lt;/a&gt;&lt;font face="Courier New"&gt;" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingName="Secure" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingSectionName="wsProfileBinding" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingConfiguration="Secure" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contractType="Indigo.Demos.ITransferContract"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpoint 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; address=&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/font&gt;&lt;a href="http://localhost:666/TransferService.svc/"&gt;&lt;font face="Courier New"&gt;http://localhost:666/TransferService.svc/&lt;/font&gt;&lt;/a&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; securereliable" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingNamespace=&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/font&gt;&lt;a href="http://webservices.gama-system.com/bindings"&gt;&lt;font face="Courier New"&gt;http://webservices.gama-system.com/bindings&lt;/font&gt;&lt;/a&gt;&lt;font face="Courier New"&gt;" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingName="SecureReliable" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingSectionName="wsProfileBinding" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingConfiguration="SecureReliable" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contractType="Indigo.Demos.ITransferContract"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpoint 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; address=&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/font&gt;&lt;a href="http://localhost:666/TransferService.svc/"&gt;&lt;font face="Courier New"&gt;http://localhost:666/TransferService.svc/&lt;/font&gt;&lt;/a&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; securereliabletransacted" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingNamespace=&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/font&gt;&lt;a href="http://webservices.gama-system.com/bindings"&gt;&lt;font face="Courier New"&gt;http://webservices.gama-system.com/bindings&lt;/font&gt;&lt;/a&gt;&lt;font face="Courier New"&gt;" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingName="SecureReliableTransacted" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingSectionName="wsProfileBinding" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingConfiguration="SecureReliableTransacted" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contractType="Indigo.Demos.ITransferContract"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpoint 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; address=&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/font&gt;&lt;a href="http://localhost:666/TransferService.svc/"&gt;&lt;font face="Courier New"&gt;http://localhost:666/TransferService.svc/&lt;/font&gt;&lt;/a&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; secureMTOM" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingNamespace=&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/font&gt;&lt;a href="http://webservices.gama-system.com/bindings"&gt;&lt;font face="Courier New"&gt;http://webservices.gama-system.com/bindings&lt;/font&gt;&lt;/a&gt;&lt;font face="Courier New"&gt;" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingName="SecureMTOM" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingSectionName="wsProfileBinding" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingConfiguration="SecureMTOM" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contractType="Indigo.Demos.ITransferContract"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpoint 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; address=&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/font&gt;&lt;a href="http://localhost:666/TransferService.svc/"&gt;&lt;font face="Courier New"&gt;http://localhost:666/TransferService.svc/&lt;/font&gt;&lt;/a&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; securereliableMTOM" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingNamespace=&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/font&gt;&lt;a href="http://webservices.gama-system.com/bindings"&gt;&lt;font face="Courier New"&gt;http://webservices.gama-system.com/bindings&lt;/font&gt;&lt;/a&gt;&lt;font face="Courier New"&gt;" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingName="SecureReliableMTOM" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingSectionName="wsProfileBinding" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingConfiguration="SecureReliableMTOM" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contractType="Indigo.Demos.ITransferContract"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpoint 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; address=&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/font&gt;&lt;a href="http://localhost:666/TransferService.svc/"&gt;&lt;font face="Courier New"&gt;http://localhost:666/TransferService.svc/&lt;/font&gt;&lt;/a&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; securereliabletransactedMTOM" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingNamespace=&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/font&gt;&lt;a href="http://webservices.gama-system.com/bindings"&gt;&lt;font face="Courier New"&gt;http://webservices.gama-system.com/bindings&lt;/font&gt;&lt;/a&gt;&lt;font face="Courier New"&gt;" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingName="SecureReliableTransactedMTOM" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingSectionName="wsProfileBinding" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bindingConfiguration="SecureReliableTransactedMTOM" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contractType="Indigo.Demos.ITransferContract"/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/service&amp;gt;&lt;br&gt;
&amp;lt;/services&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
It can be seen that almost every endpoint (two are bound to the same binding) is bound
to a different binding.&lt;br&gt;
The service is therefore exposing its functionality using the following endpoints:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://localhost:666/TransferService.svc/"&gt;&lt;font face="Courier New"&gt;http://localhost:666/TransferService.svc/&lt;/font&gt;&lt;/a&gt; 
&lt;li&gt;
&lt;a href="http://localhost:666/TransferService.svc/secure"&gt;&lt;font face="Courier New"&gt;http://localhost:666/TransferService.svc/secure&lt;/font&gt;&lt;/a&gt; 
&lt;li&gt;
&lt;a href="http://localhost:666/TransferService.svc/securereliable"&gt;&lt;font face="Courier New"&gt;http://localhost:666/TransferService.svc/securereliable&lt;/font&gt;&lt;/a&gt; 
&lt;li&gt;
&lt;a href="http://localhost:666/TransferService.svc/securereliabletransacted"&gt;&lt;font face="Courier New"&gt;http://localhost:666/TransferService.svc/securereliabletransacted&lt;/font&gt;&lt;/a&gt; 
&lt;li&gt;
&lt;a href="http://localhost:666/TransferService.svc/secureMTOM"&gt;&lt;font face="Courier New"&gt;http://localhost:666/TransferService.svc/secureMTOM&lt;/font&gt;&lt;/a&gt; 
&lt;li&gt;
&lt;a href="http://localhost:666/TransferService.svc/securereliableMTOM"&gt;&lt;font face="Courier New"&gt;http://localhost:666/TransferService.svc/securereliableMTOM&lt;/font&gt;&lt;/a&gt; 
&lt;li&gt;
&lt;a href="http://localhost:666/TransferService.svc/securereliabletransactedMTOM"&gt;&lt;font face="Courier New"&gt;http://localhost:666/TransferService.svc/securereliabletransactedMTOM&lt;/font&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
The first endpoint in this example is considered a default one and is mapped to the
same binding as the &lt;font face="Courier New"&gt;*securereliableMTOM&lt;/font&gt; endpoint.
&lt;/p&gt;
&lt;p&gt;
The problem with this is that current WCF’s WSDLExporter maps different endpoints
into WSDL ports, but WSDL ports have a requirement to be uniquely named. The default
port name construction is done by using the binding type name (i.e. &lt;font face="Courier New"&gt;wsProfileBinding&lt;/font&gt;, &lt;font face="Courier New"&gt;basicProfileBinding&lt;/font&gt;),
which is concatenated with the contract name.
&lt;/p&gt;
&lt;p&gt;
Therefore, when one has defined multiple bindings from the same binding type a name
collision occurs (six WSDL ports with the same QName (namespace and local name)).
This can be avoided using a &lt;font face="Courier New"&gt;bindingNamespace&lt;/font&gt; attribute
as well as &lt;font face="Courier New"&gt;bindingName&lt;/font&gt; attribute. In this example
we set the &lt;font face="Courier New"&gt;bindingNamespace&lt;/font&gt; to &lt;a href="http://webservices.gama-system.com/bindings"&gt;http://webservices.gama-system.com/bindings&lt;/a&gt; for
all bindings and made the name unique by using the bindingName attribute.
&lt;/p&gt;
&lt;p&gt;
There are currently two weird design decisions in multiple binding support of WCF.
First &lt;font face="Courier New"&gt;bindingNamespace&lt;/font&gt; and &lt;font face="Courier New"&gt;bindingName&lt;/font&gt; attributes
are bound to endpoints and not bindings. It would probably be more appropriate to
put binding’s namespace and name into the &lt;font face="Courier New"&gt;&amp;lt;binding&amp;gt;&lt;/font&gt; element.
Second, binding name is not propagated into WSDL properly when the same binding is
used in two or more endpoints (in this example &lt;a href="http://localhost:666/TransferService.svc/"&gt;http://localhost:666/TransferService.svc/&lt;/a&gt; and &lt;a href="http://localhost:666/TransferService.svc/securereliableMTOM"&gt;http://localhost:666/TransferService.svc/securereliableMTOM&lt;/a&gt; endpoints
are bound to &lt;font face="Courier New"&gt;Default&lt;/font&gt; binding. If you look closely
into the generated WSDL, you will see that the matching WSDL ports are not named after &lt;font face="Courier New"&gt;bindingName&lt;/font&gt; attribute.
&lt;/p&gt;
&lt;p&gt;
These are non-breaking issues and will probably be addressed for beta 2 of WCF.
&lt;/p&gt;
&lt;p&gt;
In the next Indigo series post, we’ll look closely into the security characteristics
of certificate based authentication.
&lt;/p&gt;
&lt;img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=5371ff94-3412-4e41-87f7-3740c8e04ac4" /&gt;</description>
      <comments>https://www.request-response.com/blog/CommentView,guid,5371ff94-3412-4e41-87f7-3740c8e04ac4.aspx</comments>
      <category>.NET 3.0 - WCF</category>
      <category>Transactions</category>
      <category>Web Services</category>
    </item>
    <item>
      <trackback:ping>https://www.request-response.com/blog/Trackback.aspx?guid=2e37a795-d1af-4581-bf13-26994f24be75</trackback:ping>
      <pingback:server>https://www.request-response.com/blog/pingback.aspx</pingback:server>
      <pingback:target>https://www.request-response.com/blog/PermaLink,guid,2e37a795-d1af-4581-bf13-26994f24be75.aspx</pingback:target>
      <dc:creator>Matevz Gacnik</dc:creator>
      <wfw:comment>https://www.request-response.com/blog/CommentView,guid,2e37a795-d1af-4581-bf13-26994f24be75.aspx</wfw:comment>
      <wfw:commentRss>https://www.request-response.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=2e37a795-d1af-4581-bf13-26994f24be75</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
As <a href="/blog/PermaLink.aspx?guid=99f5efca-a436-4699-a45c-258f86e72d32">last year</a>,
I spoke on <a href="http://cot.uni-mb.si/ots2004/">OTS 2004</a> too.
</p>
        <p>
This time, we discussed transactional semantics in weakly bound, distributed systems.
</p>
        <p>
Hope to see you on 2005's annual reincarnation of a great conference.
</p>
        <img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=2e37a795-d1af-4581-bf13-26994f24be75" />
      </body>
      <title>OTS 2004</title>
      <guid isPermaLink="false">https://www.request-response.com/blog/PermaLink,guid,2e37a795-d1af-4581-bf13-26994f24be75.aspx</guid>
      <link>https://www.request-response.com/blog/PermaLink,guid,2e37a795-d1af-4581-bf13-26994f24be75.aspx</link>
      <pubDate>Sun, 20 Jun 2004 21:19:39 GMT</pubDate>
      <description>&lt;p&gt;
As &lt;a href="/blog/PermaLink.aspx?guid=99f5efca-a436-4699-a45c-258f86e72d32"&gt;last year&lt;/a&gt;,
I spoke on &lt;a href="http://cot.uni-mb.si/ots2004/"&gt;OTS 2004&lt;/a&gt; too.
&lt;/p&gt;
&lt;p&gt;
This time, we discussed transactional semantics in weakly bound, distributed systems.
&lt;/p&gt;
&lt;p&gt;
Hope to see you on 2005's annual reincarnation of a great conference.
&lt;/p&gt;
&lt;img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=2e37a795-d1af-4581-bf13-26994f24be75" /&gt;</description>
      <comments>https://www.request-response.com/blog/CommentView,guid,2e37a795-d1af-4581-bf13-26994f24be75.aspx</comments>
      <category>Transactions</category>
      <category>Web Services</category>
      <category>Work</category>
    </item>
  </channel>
</rss>