<?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 - .NET 3.0 - WF</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 - .NET 3.0 - WF</title>
      <link>https://www.request-response.com/blog/</link>
    </image>
    <language>en-us</language>
    <copyright>Matevz Gacnik</copyright>
    <lastBuildDate>Thu, 15 Feb 2007 05:09:56 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=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=9c42242b-1d7c-4864-aa64-ab72dbf27ada</trackback:ping>
      <pingback:server>https://www.request-response.com/blog/pingback.aspx</pingback:server>
      <pingback:target>https://www.request-response.com/blog/PermaLink,guid,9c42242b-1d7c-4864-aa64-ab72dbf27ada.aspx</pingback:target>
      <dc:creator>Matevz Gacnik</dc:creator>
      <wfw:comment>https://www.request-response.com/blog/CommentView,guid,9c42242b-1d7c-4864-aa64-ab72dbf27ada.aspx</wfw:comment>
      <wfw:commentRss>https://www.request-response.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=9c42242b-1d7c-4864-aa64-ab72dbf27ada</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just finished presenting my talk on the October 2006 Slovenian MSDN event.
</p>
        <p>
Here are the deliverables:
</p>
        <p>
Code: <a href="http://www.request-response.com/blog/content/binary/CalculateTaxServiceWorkflow.zip">Download</a><br />
PPT: <a href="http://www.request-response.com/blog/content/binary/WCF+WF_Oct2006.zip">Download</a> [Slovenian]
</p>
        <p>
Solution file includes:
</p>
        <ol>
          <li>
WCF service using <font face="Courier New">wsDualHttpBinding</font> for duplex session
communication scenario. WCF service hosts a workflow which computes stock tax based
on the current (complex) Slovenian legislation.</li>
          <li>
WF workflow named <font face="Courier New">ComputeTaxWorkflow</font><font face="Verdana">.
Workflow calls out to our public ASP .NET WebServices: <a href="http://webservices.gama-system.com/stockquotes.asmx">StockQuotes</a> and <a href="http://webservices.gama-system.com/exchangerates.asmx">ExchangeRates</a>.</font></li>
          <li>
WCF Client, which sends requests and receives responses when the workflow is done</li>
        </ol>
        <p>
Check it out. It's free.
</p>
        <img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=9c42242b-1d7c-4864-aa64-ab72dbf27ada" />
      </body>
      <title>MSDN Event Presentation: Code and PPT</title>
      <guid isPermaLink="false">https://www.request-response.com/blog/PermaLink,guid,9c42242b-1d7c-4864-aa64-ab72dbf27ada.aspx</guid>
      <link>https://www.request-response.com/blog/PermaLink,guid,9c42242b-1d7c-4864-aa64-ab72dbf27ada.aspx</link>
      <pubDate>Mon, 23 Oct 2006 10:04:56 GMT</pubDate>
      <description>&lt;p&gt;
I just finished presenting my talk on the October 2006 Slovenian MSDN event.
&lt;/p&gt;
&lt;p&gt;
Here are the deliverables:
&lt;/p&gt;
&lt;p&gt;
Code: &lt;a href="http://www.request-response.com/blog/content/binary/CalculateTaxServiceWorkflow.zip"&gt;Download&lt;/a&gt;
&lt;br&gt;
PPT: &lt;a href="http://www.request-response.com/blog/content/binary/WCF+WF_Oct2006.zip"&gt;Download&lt;/a&gt;&amp;nbsp;[Slovenian]
&lt;/p&gt;
&lt;p&gt;
Solution file includes:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
WCF service using &lt;font face="Courier New"&gt;wsDualHttpBinding&lt;/font&gt; for duplex session
communication scenario. WCF service hosts a workflow which computes stock tax based
on the current (complex) Slovenian legislation.&lt;/li&gt;
&lt;li&gt;
WF workflow named &lt;font face="Courier New"&gt;ComputeTaxWorkflow&lt;/font&gt;&lt;font face=Verdana&gt;.
Workflow calls out to our public ASP .NET WebServices: &lt;a href="http://webservices.gama-system.com/stockquotes.asmx"&gt;StockQuotes&lt;/a&gt; and &lt;a href="http://webservices.gama-system.com/exchangerates.asmx"&gt;ExchangeRates&lt;/a&gt;.&lt;/font&gt;
&lt;/li&gt;
&lt;li&gt;
WCF Client, which sends requests and receives responses when the workflow is done&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Check it out. It's free.
&lt;/p&gt;
&lt;img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=9c42242b-1d7c-4864-aa64-ab72dbf27ada" /&gt;</description>
      <comments>https://www.request-response.com/blog/CommentView,guid,9c42242b-1d7c-4864-aa64-ab72dbf27ada.aspx</comments>
      <category>.NET 3.0 - General</category>
      <category>.NET 3.0 - WCF</category>
      <category>.NET 3.0 - WF</category>
      <category>Work</category>
    </item>
    <item>
      <trackback:ping>https://www.request-response.com/blog/Trackback.aspx?guid=4c9487e9-b98a-48ae-902a-f08b8c56f9fd</trackback:ping>
      <pingback:server>https://www.request-response.com/blog/pingback.aspx</pingback:server>
      <pingback:target>https://www.request-response.com/blog/PermaLink,guid,4c9487e9-b98a-48ae-902a-f08b8c56f9fd.aspx</pingback:target>
      <dc:creator>Matevz Gacnik</dc:creator>
      <wfw:comment>https://www.request-response.com/blog/CommentView,guid,4c9487e9-b98a-48ae-902a-f08b8c56f9fd.aspx</wfw:comment>
      <wfw:commentRss>https://www.request-response.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=4c9487e9-b98a-48ae-902a-f08b8c56f9fd</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
We had a nice discussion throughout the day today, together with around 50 attendees.
It's hard to even cover feature changes of .NET 3.0 in a day, but we managed
to cover the important things of WCF and WF, spending a complete day inside the Visual
Studio.
</p>
        <p>
Here are the demos: <a href="http://www.request-response.com/blog/content/binary/WCFWFDemosOct2006.zip">Download</a><br />
And the PPT slides: <a href="http://www.request-response.com/blog/content/binary/WCF_WF_Oct2006.zip">Download</a> [Slovenian]
</p>
        <p>
And the link to the Tom Archer's <a href="http://blogs.msdn.com/tomarcher/archive/2006/07/17/668572.aspx">compatibility
matrix</a> for the .NET Framework 3.0 downloads.
</p>
        <p>
Thanks to everyone who attended.
</p>
        <img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=4c9487e9-b98a-48ae-902a-f08b8c56f9fd" />
      </body>
      <title>.NET 3.0 Middleware Technologies Day</title>
      <guid isPermaLink="false">https://www.request-response.com/blog/PermaLink,guid,4c9487e9-b98a-48ae-902a-f08b8c56f9fd.aspx</guid>
      <link>https://www.request-response.com/blog/PermaLink,guid,4c9487e9-b98a-48ae-902a-f08b8c56f9fd.aspx</link>
      <pubDate>Thu, 05 Oct 2006 17:03:06 GMT</pubDate>
      <description>&lt;p&gt;
We had a nice discussion throughout the day today, together with around 50 attendees.
It's hard to even&amp;nbsp;cover feature changes of .NET 3.0 in a day, but we managed
to cover the important things of WCF and WF, spending a complete day inside the Visual
Studio.
&lt;/p&gt;
&lt;p&gt;
Here are the demos: &lt;a href="http://www.request-response.com/blog/content/binary/WCFWFDemosOct2006.zip"&gt;Download&lt;/a&gt;
&lt;br&gt;
And the PPT slides: &lt;a href="http://www.request-response.com/blog/content/binary/WCF_WF_Oct2006.zip"&gt;Download&lt;/a&gt;&amp;nbsp;[Slovenian]
&lt;/p&gt;
&lt;p&gt;
And the link to the Tom Archer's&amp;nbsp;&lt;a href="http://blogs.msdn.com/tomarcher/archive/2006/07/17/668572.aspx"&gt;compatibility
matrix&lt;/a&gt; for the .NET Framework 3.0 downloads.
&lt;/p&gt;
&lt;p&gt;
Thanks to everyone who attended.
&lt;/p&gt;
&lt;img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=4c9487e9-b98a-48ae-902a-f08b8c56f9fd" /&gt;</description>
      <comments>https://www.request-response.com/blog/CommentView,guid,4c9487e9-b98a-48ae-902a-f08b8c56f9fd.aspx</comments>
      <category>.NET 3.0 - WCF</category>
      <category>.NET 3.0 - WF</category>
      <category>Architecture</category>
      <category>Work</category>
    </item>
    <item>
      <trackback:ping>https://www.request-response.com/blog/Trackback.aspx?guid=86bd92f2-13fd-4454-ab88-272a4a8be875</trackback:ping>
      <pingback:server>https://www.request-response.com/blog/pingback.aspx</pingback:server>
      <pingback:target>https://www.request-response.com/blog/PermaLink,guid,86bd92f2-13fd-4454-ab88-272a4a8be875.aspx</pingback:target>
      <dc:creator>Matevz Gacnik</dc:creator>
      <wfw:comment>https://www.request-response.com/blog/CommentView,guid,86bd92f2-13fd-4454-ab88-272a4a8be875.aspx</wfw:comment>
      <wfw:commentRss>https://www.request-response.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=86bd92f2-13fd-4454-ab88-272a4a8be875</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Last article discusses service-workflow cooperation options in <a href="http://msdn.microsoft.com/winfx/">WinFX</a> and
dives into communication scenarios for <a href="http://www.windowsworkflow.net/">Windows
Workflow Foundation</a>.
</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-WorkflowsServices.doc">Sodelovanje
storitev in delovnih tokov</a>
        </p>
        <p>
          <em>
            <a href="http://www.request-response.com/blog/content/binary/MatevzGacnik-WorkflowsServices.doc">
              <img alt="Sodelovanje storitev in delovnih tokov" hspace="0" src="http://www.request-response.com/blog/images/matevzgacnik-workflowsservices.jpg" align="baseline" border="1" />
            </a>
          </em>
        </p>
        <img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=86bd92f2-13fd-4454-ab88-272a4a8be875" />
      </body>
      <title>Article: Cooperation Between Workflows and Services</title>
      <guid isPermaLink="false">https://www.request-response.com/blog/PermaLink,guid,86bd92f2-13fd-4454-ab88-272a4a8be875.aspx</guid>
      <link>https://www.request-response.com/blog/PermaLink,guid,86bd92f2-13fd-4454-ab88-272a4a8be875.aspx</link>
      <pubDate>Wed, 07 Jun 2006 09:29:02 GMT</pubDate>
      <description>&lt;p&gt;
Last article discusses&amp;nbsp;service-workflow cooperation&amp;nbsp;options in &lt;a href="http://msdn.microsoft.com/winfx/"&gt;WinFX&lt;/a&gt; and
dives into communication scenarios for &lt;a href="http://www.windowsworkflow.net/"&gt;Windows
Workflow Foundation&lt;/a&gt;.
&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-WorkflowsServices.doc"&gt;Sodelovanje
storitev in delovnih tokov&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;a href="http://www.request-response.com/blog/content/binary/MatevzGacnik-WorkflowsServices.doc"&gt;&lt;img alt="Sodelovanje storitev in delovnih tokov" hspace=0 src="http://www.request-response.com/blog/images/matevzgacnik-workflowsservices.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=86bd92f2-13fd-4454-ab88-272a4a8be875" /&gt;</description>
      <comments>https://www.request-response.com/blog/CommentView,guid,86bd92f2-13fd-4454-ab88-272a4a8be875.aspx</comments>
      <category>Articles</category>
      <category>.NET 3.0 - WCF</category>
      <category>.NET 3.0 - WF</category>
    </item>
    <item>
      <trackback:ping>https://www.request-response.com/blog/Trackback.aspx?guid=c3e15d02-a74b-4ed4-a282-925342bdaddc</trackback:ping>
      <pingback:server>https://www.request-response.com/blog/pingback.aspx</pingback:server>
      <pingback:target>https://www.request-response.com/blog/PermaLink,guid,c3e15d02-a74b-4ed4-a282-925342bdaddc.aspx</pingback:target>
      <dc:creator>Matevz Gacnik</dc:creator>
      <wfw:comment>https://www.request-response.com/blog/CommentView,guid,c3e15d02-a74b-4ed4-a282-925342bdaddc.aspx</wfw:comment>
      <wfw:commentRss>https://www.request-response.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=c3e15d02-a74b-4ed4-a282-925342bdaddc</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Having the ability to call services from inside your workflows is a good thing. Things
get a little obfuscated when one wants to expose a WCF based service to Windows Workflow
Foundation (WF).
</p>
        <p>
What it comes down to is that currently (beta 2 build of WF) we do not have any built-in
workflow activities which would allow you to communicate with the WCF advanced services
(meaning WS-Security enabled, TCP based, WS-RM enabled, WS-Tx enabled, ...).
</p>
        <p>
Assuming we have an <font face="Courier New">OrderService</font> exposed using the
following config:
</p>
        <p>
          <font face="Courier New">&lt;configuration&gt;<br />
  &lt;system.serviceModel&gt;<br />
    &lt;bindings&gt;<br />
      &lt;wsHttpBinding&gt;<br /><font color="#a52a2a">        &lt;binding name="Default"&gt;<br />
          &lt;security mode="None"/&gt;<br />
        &lt;/binding&gt;<br />
        &lt;binding name="Secure"&gt;<br />
          &lt;security mode="Message"&gt;<br />
            &lt;message clientCredentialType="Windows"/&gt;<br />
          &lt;/security&gt;<br />
        &lt;/binding&gt;<br />
        &lt;binding name="Reliable"&gt;<br />
          &lt;reliableSession enabled="true"
ordered="true"/&gt;<br />
        &lt;/binding&gt;<br /></font>      &lt;/wsHttpBinding&gt;<br />
    &lt;/bindings&gt;<br />
    &lt;services&gt;<br />
      &lt;service name="WCFCalledByWorkflow.OrderService"
&gt;<br /><font color="#a52a2a">        &lt;endpoint address=""<br />
                 
binding="wsHttpBinding"<br />
                 
behaviorConfiguration="Default"<br />
                 
contract="WCFCalledByWorkflow.IOrderService" /&gt;<br />
        &lt;endpoint address="/secure"<br />
                 
binding="wsHttpBinding"<br />
                 
behaviorConfiguration="Secure"<br />
                 
contract="WCFCalledByWorkflow.IOrderService" /&gt;<br />
        &lt;endpoint address="/reliable"<br />
                 
binding="wsHttpBinding"<br />
                 
behaviorConfiguration="Reliable"<br />
                 
contract="WCFCalledByWorkflow.IOrderService" /&gt;<br /></font>      &lt;/service&gt;<br />
    &lt;/services&gt;<br />
  &lt;/system.serviceModel&gt;<br />
&lt;/configuration&gt;</font>
        </p>
        <p>
This, combined with the following hosting app:
</p>
        <p>
          <font face="Courier New">using (ServiceHost sh = new ServiceHost(typeof(OrderService),<br />
   </font>
          <font face="Courier New">new Uri("</font>
          <font face="Courier New">http://localhost:666/OrderService</font>
          <font face="Courier New">")))<br />
{<br />
   sh.Open();<br />
   Console.WriteLine("Order service running..\n");<br />
   Console.WriteLine("Listening on:");<br /><font color="#a52a2a">   foreach(ServiceEndpoint se in sh.Description.Endpoints)<br />
   {<br />
      Console.WriteLine(se.Address.ToString());<br />
   }<br /></font>   Console.WriteLine("\nPress [Enter] to stop the service.");<br />
   Console.ReadLine();<br />
   sh.Close();<br />
}</font>
        </p>
        <p>
Would produce the following output when run:
</p>
        <p>
          <font face="Courier New">Order service running..</font>
        </p>
        <p>
          <font face="Courier New">Listening on:<br /></font>
          <font color="#a52a2a">
            <font face="Courier New">http://localhost:666/OrderService</font>
            <br />
            <font face="Courier New">http://localhost:666/OrderService/secure</font>
            <br />
            <font face="Courier New">http://localhost:666/OrderService/reliable</font>
          </font>
        </p>
        <p>
          <font face="Courier New">Press [Enter] to stop the service.</font>
        </p>
        <p>
Now, this is not enough. Our service exposes three different endpoints, each one has
different message requirements. And what is more important, all three are based on
SOAP 1.2 + WS-Addressing.
</p>
        <p>
There is a 'Default' endpoint which is plain vanilla SOAP 1.2 endpoint, without any
security (have to mention it: WCF services <em>are secure by default</em>, one has
to <em>turn off security</em> to achive this). Second endpoint uses Windows based
message security and third turns on WS-RM. Security wise, second and third endpoints
are the same (remember, defaults?).
</p>
        <p>
As said, WF is currently not able to communicate with any of the above endpoints.
What needs to be done is adding another endpoint to your service, which would expose
it in ASMX compatible way.
</p>
        <p>
The new config is this:
</p>
        <p>
          <font face="Courier New">&lt;configuration&gt;<br />
  &lt;system.serviceModel&gt;<br />
    &lt;bindings&gt;<br />
      &lt;wsHttpBinding&gt;<br />
        &lt;binding name="Default"&gt;<br />
          &lt;security mode="None"/&gt;<br />
        &lt;/binding&gt;<br />
        &lt;binding name="Secure"&gt;<br />
          &lt;security mode="Message"&gt;<br />
            &lt;message clientCredentialType="Windows"/&gt;<br />
          &lt;/security&gt;<br />
        &lt;/binding&gt;<br />
        &lt;binding name="Reliable"&gt;<br />
          &lt;reliableSession enabled="true"
ordered="true"/&gt;<br />
        &lt;/binding&gt;<br />
      &lt;/wsHttpBinding&gt;<br />
    &lt;/bindings&gt;<br />
    &lt;services&gt;<br />
      &lt;service name="WCFCalledByWorkflow.OrderService"
&gt;<br />
        &lt;endpoint address=""<br />
                 
binding="wsHttpBinding"<br />
                 
behaviorConfiguration="Default"<br />
                 
contract="WCFCalledByWorkflow.IOrderService" /&gt;<br />
        &lt;endpoint address="/secure"<br />
                 
binding="wsHttpBinding"<br />
                 
behaviorConfiguration="Secure"<br />
                 
contract="WCFCalledByWorkflow.IOrderService" /&gt;<br />
        &lt;endpoint address="/reliable"<br />
                 
binding="wsHttpBinding"<br />
                 
behaviorConfiguration="Reliable"<br />
                 
contract="WCFCalledByWorkflow.IOrderService" /&gt;<br /><font color="#a52a2a">        &lt;endpoint address="/legacy"<br />
                 
binding="basicHttpBinding"<br />
                 
contract="WCFCalledByWorkflow.IOrderService"/&gt;<br /></font>      &lt;/service&gt;<br />
    &lt;/services&gt;<br />
  &lt;/system.serviceModel&gt;<br />
&lt;/configuration&gt;</font>
        </p>
        <p>
So our Windows Workflow Foundation compatible endpoint is <font face="Courier New">&lt;base
address&gt;/legacy</font>. 
</p>
        <p>
What this means is that you can bind all your <font face="Courier New">InvokeWebService</font> activities
inside workflows to published WCF services by just adding another ASMX compatible
endpoint to the WCF service.
</p>
        <p>
The difference in two WCF configs is here:
</p>
        <p>
          <font face="Courier New">&lt;endpoint address="/legacy"<br />
   binding="basicHttpBinding"<br />
   contract="WCFCalledByWorkflow.IOrderService"<br /></font>
          <font face="Courier New">/&gt;</font>
        </p>
        <p>
Code sample can be downloaded <a href="http://www.request-response.com/blog/content/binary/workflowinvokingwcf.zip">here</a>.
It includes two projects, a WF and a WCF project. <font face="Courier New">ServiceHost</font> is
implemented.
</p>
        <img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=c3e15d02-a74b-4ed4-a282-925342bdaddc" />
      </body>
      <title>Windows Workflow Foundation: Calling WCF Services</title>
      <guid isPermaLink="false">https://www.request-response.com/blog/PermaLink,guid,c3e15d02-a74b-4ed4-a282-925342bdaddc.aspx</guid>
      <link>https://www.request-response.com/blog/PermaLink,guid,c3e15d02-a74b-4ed4-a282-925342bdaddc.aspx</link>
      <pubDate>Wed, 31 May 2006 10:54:58 GMT</pubDate>
      <description>&lt;p&gt;
Having the ability to call services from inside your workflows is a good thing. Things
get a little obfuscated when one wants to expose a WCF based service to Windows Workflow
Foundation (WF).
&lt;/p&gt;
&lt;p&gt;
What it comes down to is that currently (beta 2 build of WF) we do not have any built-in
workflow activities which would allow you to communicate with the WCF advanced services
(meaning WS-Security enabled, TCP based, WS-RM enabled, WS-Tx enabled, ...).
&lt;/p&gt;
&lt;p&gt;
Assuming we have an &lt;font face="Courier New"&gt;OrderService&lt;/font&gt; exposed using the
following config:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;lt;configuration&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;system.serviceModel&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bindings&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;wsHttpBinding&amp;gt;&lt;br&gt;
&lt;font color=#a52a2a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;binding name="Default"&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;security mode="None"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;binding name="Secure"&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;security mode="Message"&amp;gt;&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;lt;message clientCredentialType="Windows"/&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;/security&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;binding name="Reliable"&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;reliableSession enabled="true"
ordered="true"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/binding&amp;gt;&lt;br&gt;
&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/wsHttpBinding&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/bindings&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;services&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;service name="WCFCalledByWorkflow.OrderService"
&amp;gt;&lt;br&gt;
&lt;font color=#a52a2a&gt;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
binding="wsHttpBinding"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
behaviorConfiguration="Default"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
contract="WCFCalledByWorkflow.IOrderService" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpoint address="/secure"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
binding="wsHttpBinding"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
behaviorConfiguration="Secure"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
contract="WCFCalledByWorkflow.IOrderService" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpoint address="/reliable"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
binding="wsHttpBinding"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
behaviorConfiguration="Reliable"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
contract="WCFCalledByWorkflow.IOrderService" /&amp;gt;&lt;br&gt;
&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/service&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/services&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/system.serviceModel&amp;gt;&lt;br&gt;
&amp;lt;/configuration&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
This, combined with the following hosting app:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;using (ServiceHost sh = new ServiceHost(typeof(OrderService),&lt;br&gt;
&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font face="Courier New"&gt;new Uri("&lt;/font&gt;&lt;font face="Courier New"&gt;http://localhost:666/OrderService&lt;/font&gt;&lt;font face="Courier New"&gt;")))&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp; sh.Open();&lt;br&gt;
&amp;nbsp;&amp;nbsp; Console.WriteLine("Order service running..\n");&lt;br&gt;
&amp;nbsp;&amp;nbsp; Console.WriteLine("Listening on:");&lt;br&gt;
&lt;font color=#a52a2a&gt;&amp;nbsp;&amp;nbsp; foreach(ServiceEndpoint se in sh.Description.Endpoints)&lt;br&gt;
&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(se.Address.ToString());&lt;br&gt;
&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&lt;/font&gt;&amp;nbsp;&amp;nbsp; Console.WriteLine("\nPress [Enter] to stop the service.");&lt;br&gt;
&amp;nbsp;&amp;nbsp; Console.ReadLine();&lt;br&gt;
&amp;nbsp;&amp;nbsp; sh.Close();&lt;br&gt;
}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
Would produce the following output when run:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;Order service running..&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;Listening on:&lt;br&gt;
&lt;/font&gt;&lt;font color=#a52a2a&gt;&lt;font face="Courier New"&gt;http://localhost:666/OrderService&lt;/font&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;http://localhost:666/OrderService/secure&lt;/font&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;http://localhost:666/OrderService/reliable&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;Press [Enter] to stop the service.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
Now, this is not enough. Our service exposes three different endpoints, each one has
different message requirements. And what is more important, all three are based on
SOAP 1.2 + WS-Addressing.
&lt;/p&gt;
&lt;p&gt;
There is a 'Default' endpoint which is plain vanilla SOAP 1.2 endpoint, without any
security (have to mention it: WCF services &lt;em&gt;are secure by default&lt;/em&gt;, one has
to &lt;em&gt;turn off security&lt;/em&gt; to achive this). Second endpoint uses Windows based
message security and third turns on WS-RM. Security wise, second and third endpoints
are the same (remember, defaults?).
&lt;/p&gt;
&lt;p&gt;
As said, WF is currently not able to communicate with any of the above endpoints.
What needs to be done is adding another endpoint to your service, which would expose
it in ASMX compatible way.
&lt;/p&gt;
&lt;p&gt;
The new config is this:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;lt;configuration&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;system.serviceModel&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bindings&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;wsHttpBinding&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;binding name="Default"&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;security mode="None"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;binding name="Secure"&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;security mode="Message"&amp;gt;&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;lt;message clientCredentialType="Windows"/&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;/security&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;binding name="Reliable"&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;reliableSession enabled="true"
ordered="true"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&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;nbsp;&amp;nbsp; &amp;lt;/wsHttpBinding&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/bindings&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;services&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;service name="WCFCalledByWorkflow.OrderService"
&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
binding="wsHttpBinding"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
behaviorConfiguration="Default"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
contract="WCFCalledByWorkflow.IOrderService" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpoint address="/secure"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
binding="wsHttpBinding"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
behaviorConfiguration="Secure"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
contract="WCFCalledByWorkflow.IOrderService" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpoint address="/reliable"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
binding="wsHttpBinding"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
behaviorConfiguration="Reliable"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
contract="WCFCalledByWorkflow.IOrderService" /&amp;gt;&lt;br&gt;
&lt;font color=#a52a2a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpoint address="/legacy"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
binding="basicHttpBinding"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
contract="WCFCalledByWorkflow.IOrderService"/&amp;gt;&lt;br&gt;
&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/service&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/services&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/system.serviceModel&amp;gt;&lt;br&gt;
&amp;lt;/configuration&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
So our Windows Workflow Foundation compatible endpoint is &lt;font face="Courier New"&gt;&amp;lt;base
address&amp;gt;/legacy&lt;/font&gt;. 
&lt;/p&gt;
&lt;p&gt;
What this means is that you can bind all your &lt;font face="Courier New"&gt;InvokeWebService&lt;/font&gt; activities
inside workflows to published WCF services by just adding another ASMX compatible
endpoint to the WCF service.
&lt;/p&gt;
&lt;p&gt;
The difference in two WCF configs is here:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;lt;endpoint address="/legacy"&lt;br&gt;
&amp;nbsp;&amp;nbsp; binding="basicHttpBinding"&lt;br&gt;
&amp;nbsp;&amp;nbsp; contract="WCFCalledByWorkflow.IOrderService"&lt;br&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;/&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
Code sample can be downloaded &lt;a href="http://www.request-response.com/blog/content/binary/workflowinvokingwcf.zip"&gt;here&lt;/a&gt;.
It includes two projects, a WF and a WCF project. &lt;font face="Courier New"&gt;ServiceHost&lt;/font&gt; is
implemented.
&lt;/p&gt;
&lt;img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=c3e15d02-a74b-4ed4-a282-925342bdaddc" /&gt;</description>
      <comments>https://www.request-response.com/blog/CommentView,guid,c3e15d02-a74b-4ed4-a282-925342bdaddc.aspx</comments>
      <category>.NET 3.0 - WCF</category>
      <category>.NET 3.0 - WF</category>
    </item>
    <item>
      <trackback:ping>https://www.request-response.com/blog/Trackback.aspx?guid=3a99c75b-d108-4fb7-8d1d-8e18c32e659b</trackback:ping>
      <pingback:server>https://www.request-response.com/blog/pingback.aspx</pingback:server>
      <pingback:target>https://www.request-response.com/blog/PermaLink,guid,3a99c75b-d108-4fb7-8d1d-8e18c32e659b.aspx</pingback:target>
      <dc:creator>Matevz Gacnik</dc:creator>
      <wfw:comment>https://www.request-response.com/blog/CommentView,guid,3a99c75b-d108-4fb7-8d1d-8e18c32e659b.aspx</wfw:comment>
      <wfw:commentRss>https://www.request-response.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=3a99c75b-d108-4fb7-8d1d-8e18c32e659b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This post will focus on how to enable <em>IIS7 in Windows Vista</em> client and to
use it to host a service activated Windows Workflow.
</p>
        <p>
Procedure is based on the current build of Windows Vista (5381.1), which is a RC1
for Beta 2 milestone. Also, <a href="http://msdn.microsoft.com/windowsvista/downloads/getthebeta/default.aspx">WinFX
February CTP</a> is used, which includes Windows Workflow Foundation Beta 2.
</p>
        <p>
There are a couple of prerequisite steps necessary to enable hosting, first of all,
installing IIS7. Go to <font face="Courier New">Control Panel/Programs/Turn on or
off Windows Features</font> and enable 'Internet Information Services':
</p>
        <p>
          <img alt="Add or remove Windows features" hspace="0" src="http://www.request-response.com/blog/images/addwinf.jpg" align="baseline" border="0" />
        </p>
        <p>
Installer in build 5381.1 (and 5365) is stable enough to be useful. If you're running
a previous build of Vista (5308, 5342) consider installing IIS by running this <em>monster</em> in
the command prompt:
</p>
        <p>
          <font face="Courier New">start /w pkgmgr /l:log.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;IIS-FTPPublishingService;IIS-FTPServer;IIS-FTPManagement;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI</font>
        </p>
        <p>
Make sure you also check <font face="Courier New">ASP.NET</font> under <font face="Courier New">World
Wide Web Services/Application Development features</font>, since this will install
and enable ASP .NET 2.0 under all IIS7 sites. You can also do this later on using <font face="Courier New">aspnet_regiis.exe</font>,
but Vista will notify you that the preferred way is using Turn on or off Windows features
dialog.
</p>
        <p>
Now, when you have IIS installed run the administrative console inside <font face="Courier New">Administrative
Tools</font><font face="Verdana"> and define a web application by right clicking on <font face="Courier New">Default
Web Site</font>:</font></p>
        <p>
          <img style="WIDTH: 520px; HEIGHT: 328px" alt="Creating application on IIS7" hspace="0" src="http://www.request-response.com/blog/images/wfservice.jpg" align="baseline" border="0" />
        </p>
        <p>
This will allow you to run your workflow as a service inside the default application
pool. You can check and notice that default application pool uses a new <em>integrated</em> IIS7
mode <em>and not </em>ISAPI as in IIS5/6.
</p>
        <p>
You're ready to deploy your workflow activated service now. use the steps described
in my <a href="http://www.request-response.com/blog/PermaLink,guid,21c95c2c-63d7-44f6-8357-1be0ecb6f264.aspx">previous
post</a>, under <strong>Ad 1</strong>.
</p>
        <p>
When you hit the service endpoint you get this:
</p>
        <p>
          <img alt="Configuration error in IIS7" hspace="0" src="http://www.request-response.com/blog/images/500error.jpg" align="baseline" border="0" />
        </p>
        <p>
IIS7 is noticing you that your config files are not compatible with the new hosting
model.
</p>
        <p>
You have two options:
</p>
        <ul>
          <li>
Change the configuration files</li>
          <li>
Change the hosting model</li>
        </ul>
        <p>
You can change the configuration files by running: <font face="Courier New">c:\windows\system32\inetsrv\appcmd.exe migrate
config "&lt;Site name&gt;/&lt;VRoot name&gt;"</font>. <font face="Courier New">AppCmd.exe</font> is
a tool which automatically migrates your old config, to IIS7's new config format.
</p>
        <p>
Another option is that you enable old style ISAPI hosting model inside your application
pool that is running your default web site (or another site, if that's what the workflow
is supposed to be running under). You can do this either by:
</p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p>
1. Running <font face="Courier New">c:\windows\system32\inetsrv\appcmd.exe set
app "&lt;Site name&gt;/&lt;VRoot name&gt;" /applicationPool: "Classic .NET AppPool".</font><font face="Verdana"> This
changes the site to use another, preconfigured app pool, which uses ISAPI by default. </font></p>
          <p>
            <font face="Verdana">Here's a screenshot of the default pipeline modes for IIS7:</font>
          </p>
          <p>
            <img alt="Application pool config in IIS7" hspace="0" src="http://www.request-response.com/blog/images/apppools.jpg" align="baseline" border="0" />
          </p>
          <p>
2. Changing the hosting model on the current <font face="Courier New">Default Web
Site</font> site. You can right click on <font face="Courier New">Application Pools/DefaultAppPool</font> and
select <font face="Courier New">Set Application Pool Defaults</font>. Then you change
the pipeline mode from <font face="Courier New">Integrated</font> to <font face="Courier New">ISAPI</font>.
Here's how you do it:
</p>
          <p>
            <img alt="Pipeline mode selection" hspace="0" src="http://www.request-response.com/blog/images/pipelinemode.jpg" align="baseline" border="0" />
          </p>
        </blockquote>
        <p>
I prefer going through route 1. Integrated mode is how you should be running your
sites under IIS7, so changing the config to make IIS7 happy is the way to go. If you
have specific ISAPI functionality (not limited to Workflows) you can, though run in
classic mode by designing your app pool around it.
</p>
        <p>
Now your service activated workflow will run and execute under IIS7. Again, beware
of the caveats I described <a href="http://www.request-response.com/blog/PermaLink,guid,21c95c2c-63d7-44f6-8357-1be0ecb6f264.aspx">here</a>.
</p>
        <img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=3a99c75b-d108-4fb7-8d1d-8e18c32e659b" />
      </body>
      <title>Windows Workflow Foundation: Running Service Activated Workflows on Windows Vista and IIS7</title>
      <guid isPermaLink="false">https://www.request-response.com/blog/PermaLink,guid,3a99c75b-d108-4fb7-8d1d-8e18c32e659b.aspx</guid>
      <link>https://www.request-response.com/blog/PermaLink,guid,3a99c75b-d108-4fb7-8d1d-8e18c32e659b.aspx</link>
      <pubDate>Thu, 11 May 2006 10:15:46 GMT</pubDate>
      <description>&lt;p&gt;
This post will focus on how to enable &lt;em&gt;IIS7 in Windows Vista&lt;/em&gt; client and to
use it to host a service activated Windows Workflow.
&lt;/p&gt;
&lt;p&gt;
Procedure is based on the current build of Windows Vista (5381.1), which is a RC1
for Beta 2 milestone. Also, &lt;a href="http://msdn.microsoft.com/windowsvista/downloads/getthebeta/default.aspx"&gt;WinFX
February CTP&lt;/a&gt; is used, which includes Windows Workflow Foundation Beta 2.
&lt;/p&gt;
&lt;p&gt;
There are a couple of prerequisite steps necessary to enable hosting, first of all,
installing IIS7. Go to &lt;font face="Courier New"&gt;Control Panel/Programs/Turn on or
off Windows Features&lt;/font&gt; and enable 'Internet Information Services':
&lt;/p&gt;
&lt;p&gt;
&lt;img alt="Add or remove Windows features" hspace=0 src="http://www.request-response.com/blog/images/addwinf.jpg" align=baseline border=0&gt;
&lt;/p&gt;
&lt;p&gt;
Installer in build 5381.1 (and 5365) is stable enough to be useful. If you're running
a previous build of Vista (5308, 5342) consider installing IIS by running this &lt;em&gt;monster&lt;/em&gt; in
the command prompt:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;start /w pkgmgr /l:log.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;IIS-FTPPublishingService;IIS-FTPServer;IIS-FTPManagement;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
Make sure you also check &lt;font face="Courier New"&gt;ASP.NET&lt;/font&gt; under &lt;font face="Courier New"&gt;World
Wide Web Services/Application Development features&lt;/font&gt;, since this will install
and enable ASP .NET 2.0 under all IIS7 sites. You can also do this later on using &lt;font face="Courier New"&gt;aspnet_regiis.exe&lt;/font&gt;,
but Vista will notify you that the preferred way is using Turn on or off Windows features
dialog.
&lt;/p&gt;
&lt;p&gt;
Now, when you have IIS installed run the administrative console inside &lt;font face="Courier New"&gt;Administrative
Tools&lt;/font&gt;&lt;font face=Verdana&gt; and define a web application by right clicking on &lt;font face="Courier New"&gt;Default
Web Site&lt;/font&gt;:&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;img style="WIDTH: 520px; HEIGHT: 328px" alt="Creating application on IIS7" hspace=0 src="http://www.request-response.com/blog/images/wfservice.jpg" align=baseline border=0&gt;
&lt;/p&gt;
&lt;p&gt;
This will allow you to run your workflow as a service inside the default application
pool. You can check and notice that default application pool uses a new &lt;em&gt;integrated&lt;/em&gt; IIS7
mode &lt;em&gt;and not &lt;/em&gt;ISAPI as in IIS5/6.
&lt;/p&gt;
&lt;p&gt;
You're ready to deploy your workflow activated service now. use the steps described
in my &lt;a href="http://www.request-response.com/blog/PermaLink,guid,21c95c2c-63d7-44f6-8357-1be0ecb6f264.aspx"&gt;previous
post&lt;/a&gt;, under &lt;strong&gt;Ad 1&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
When you hit the service endpoint you get this:
&lt;/p&gt;
&lt;p&gt;
&lt;img alt="Configuration error in IIS7" hspace=0 src="http://www.request-response.com/blog/images/500error.jpg" align=baseline border=0&gt;
&lt;/p&gt;
&lt;p&gt;
IIS7 is noticing you that your config files are not compatible with the new hosting
model.
&lt;/p&gt;
&lt;p&gt;
You have two options:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Change the configuration files&lt;/li&gt;
&lt;li&gt;
Change the hosting model&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
You can change the configuration files by running: &lt;font face="Courier New"&gt;c:\windows\system32\inetsrv\appcmd.exe&amp;nbsp;migrate
config&amp;nbsp;"&amp;lt;Site name&amp;gt;/&amp;lt;VRoot name&amp;gt;"&lt;/font&gt;. &lt;font face="Courier New"&gt;AppCmd.exe&lt;/font&gt; is
a tool which automatically migrates your old config, to IIS7's new config format.
&lt;/p&gt;
&lt;p&gt;
Another option is that you enable old style ISAPI hosting model inside your application
pool that is running your default web site (or another site, if that's what the workflow
is supposed to be running under). You can do this either by:
&lt;/p&gt;
&lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p&gt;
1. Running&amp;nbsp;&lt;font face="Courier New"&gt;c:\windows\system32\inetsrv\appcmd.exe&amp;nbsp;set
app&amp;nbsp;"&amp;lt;Site name&amp;gt;/&amp;lt;VRoot name&amp;gt;" /applicationPool: "Classic .NET AppPool".&lt;/font&gt;&lt;font face=Verdana&gt; This
changes the site to use another, preconfigured app pool, which uses ISAPI by default. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face=Verdana&gt;Here's a screenshot of the default pipeline modes for IIS7:&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;img alt="Application pool config in IIS7" hspace=0 src="http://www.request-response.com/blog/images/apppools.jpg" align=baseline border=0&gt;
&lt;/p&gt;
&lt;p&gt;
2. Changing the hosting model on the current &lt;font face="Courier New"&gt;Default Web
Site&lt;/font&gt; site. You can right click on &lt;font face="Courier New"&gt;Application Pools/DefaultAppPool&lt;/font&gt; and
select &lt;font face="Courier New"&gt;Set Application Pool Defaults&lt;/font&gt;. Then you change
the pipeline mode from &lt;font face="Courier New"&gt;Integrated&lt;/font&gt; to &lt;font face="Courier New"&gt;ISAPI&lt;/font&gt;.
Here's how you do it:
&lt;/p&gt;
&lt;p&gt;
&lt;img alt="Pipeline mode selection" hspace=0 src="http://www.request-response.com/blog/images/pipelinemode.jpg" align=baseline border=0&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
I prefer going through route 1. Integrated mode is how you should be running your
sites under IIS7, so changing the config to make IIS7 happy is the way to go. If you
have specific ISAPI functionality (not limited to Workflows) you can, though run in
classic mode by designing your app pool around it.
&lt;/p&gt;
&lt;p&gt;
Now your service activated workflow will run and execute under IIS7. Again, beware
of the caveats I described &lt;a href="http://www.request-response.com/blog/PermaLink,guid,21c95c2c-63d7-44f6-8357-1be0ecb6f264.aspx"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=3a99c75b-d108-4fb7-8d1d-8e18c32e659b" /&gt;</description>
      <comments>https://www.request-response.com/blog/CommentView,guid,3a99c75b-d108-4fb7-8d1d-8e18c32e659b.aspx</comments>
      <category>Web Services</category>
      <category>Windows Vista</category>
      <category>.NET 3.0 - WF</category>
    </item>
    <item>
      <trackback:ping>https://www.request-response.com/blog/Trackback.aspx?guid=21c95c2c-63d7-44f6-8357-1be0ecb6f264</trackback:ping>
      <pingback:server>https://www.request-response.com/blog/pingback.aspx</pingback:server>
      <pingback:target>https://www.request-response.com/blog/PermaLink,guid,21c95c2c-63d7-44f6-8357-1be0ecb6f264.aspx</pingback:target>
      <dc:creator>Matevz Gacnik</dc:creator>
      <wfw:comment>https://www.request-response.com/blog/CommentView,guid,21c95c2c-63d7-44f6-8357-1be0ecb6f264.aspx</wfw:comment>
      <wfw:commentRss>https://www.request-response.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=21c95c2c-63d7-44f6-8357-1be0ecb6f264</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
There are currently a couple of options to expose a Windows Workflow as as service.
</p>
        <ol>
          <li>
There is a native option to publish a developed Workflow Library project as a ASP
.NET Web Service (ASMX). 
</li>
          <li>
You can host it yourself (ASMX, WCF) 
</li>
          <li>
            <a href="http://www.softwaremaker.net/blog/">William Tay</a> is doing excellent work
towards <a href="http://www.softwaremaker.net/blog/HookingAWorkflowIntoYourWCFDispatcher.aspx">hosting
a workflow inside the WCF service pipeline</a> (WCF) 
</li>
          <li>
            <a href="http://www.codeproject.com/script/profile/whos_who.asp?vt=arts&amp;id=24570">Roman
Kiss</a> created a <a href="http://windowscommunication.net/ControlGallery/ControlDetail.aspx?Control=2278&amp;tabindex=2">static
WorkflowInvoker class</a>, which does all the heavy liting for you, if you want to
host your workflow inside the WCF service method (WCF)</li>
        </ol>
        <p>
I'm going to focus on Ad 1 and Ad 2 in this post.
</p>
        <p>
          <strong>Ad 1:</strong>
        </p>
        <p>
There's an option to host your workflow library inside a web service by using a "Publish
as a Web Service" option inside Visual Studio 2005. This creates a separate ASP .NET
Web Service project inside your current solution, which you can later manually or
automatically publish as a web site to your IIS of choice.
</p>
        <p>
The are <em>two major downsides</em> to this story. The first is that this gives
you practically no control over how the web service is created. Second downside,
while documented, is that the current implementation of <font face="Courier New">System.Workflow.Runtime.WorkflowWebHostingModule</font> works
in particular ways with the workflow persistence story.
</p>
        <p>
Let's assume we have to following interface defined for this web service:
</p>
        <p>
          <font face="Courier New">interface <strong>IServiceInterface<br /></strong></font>
          <font face="Courier New">{<br /></font>
          <font face="Courier New">   void <strong>SendOrder</strong>(Order
order);<br /></font>
          <font face="Courier New">   Order <strong>GetOrder</strong>(Guid
guidOrder);<br /></font>
          <font face="Courier New">   int <strong>GetOrderStatus</strong>(Guid
guidOrder);<br /></font>
          <font face="Courier New">}</font>
        </p>
        <p>
What happens is (request number 1):
</p>
        <ol>
          <li>
You publish your workflow as a web service 
</li>
          <li>
You hit the service endpoint with a browser 
</li>
          <li>
Workflow instance gets created, is run and returns a result 
</li>
          <li>
At this time the workflow runtime (System.Workflow.Runtime.WorkflowRuntime instance)
creates a workflow instance and runs it. Since workflow completes succesfully it destroys
the instance at the end of execution. 
</li>
          <li>
Workflow runtime returns a cookie with the workflow instance back to the browser and
since IE's default setting is to accept cookies, it is written to the client's disk</li>
        </ol>
        <p>
All good, right?
</p>
        <p>
Actually, what happens during request number 2?
</p>
        <ol>
          <li>
You hit the endpoint <strong>again</strong></li>
          <li>
IE knows that the site has a persisted cookie, so it sends it bundled with the SOAP
request 
</li>
          <li>
Workflow runtime sees it and tries to load the specified workflow instance 
</li>
          <li>
This instance is long gone, it does not exist in memory (it has been destroyed, remember?),
so workflow runtime tries to rehydrate it from a persistence store. If there is a
persistence store defined it goes there (most probably <font face="Courier New">WorkflowPersistenceStore</font> in
SQL Server) and correctly identifies that the workflow instance is not present, so
it <strong>fails</strong> with <font face="Courier New">'Workflow with id &lt;GUID&gt;
not found in state persistence store.'</font>. If the persistence store is not
defined for this workflow it <strong>fails</strong> with <font face="Courier New">'The
workflow hosting environment does not have a persistence service as required by an
operation on the workflow instance &lt;GUID&gt;.'</font>.</li>
        </ol>
        <p>
And all this is actually the expected behavior if you think hard enough. Workaround?
Hit the endpoint with a newly loaded IE window. It works every time, since a
cookie with an instance ID is not present.
</p>
        <p>
Another thing to mention here is that this issue does not manifest itself if you hit
the endpoint programatically using the web service proxy, unless you are using a <font face="Courier New">CookieContainer</font> class
to cache the returning cookies.
</p>
        <p>
          <strong>Ad 2:</strong>
        </p>
        <p>
Hosting a Windows Workflow manually is another option, which gives you more flexibility
towards the service detail tweeking.
</p>
        <p>
You can host it using the following code:
</p>
        <p>
          <font face="Courier New">[WebService(Namespace = "</font>
          <font face="Courier New">http://webservices.gama-system.com/</font>
          <font face="Courier New">")]<br />
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />
public class WorkflowService : System.Web.Services.WebService<br />
{<br />
    // workflow runtime<br />
    <strong>private static WorkflowRuntime workflowRuntime = new WorkflowRuntime();</strong><br />
    <br /></font>
          <font face="Courier New">    [WebMethod]<br />
    public void SendOrder(Order order)<br />
    {<br /></font>
          <font face="Courier New">        AutoResetEvent
waitHandle = new AutoResetEvent(false);<br />
        workflowRuntime.WorkflowCompleted +=<br />
           delegate(object sender,
WorkflowCompletedEventArgs e)<br />
        {<br />
            waitHandle.Set();<br />
        };<br />
        
<br />
        workflowRuntime.WorkflowTerminated +=<br />
           delegate(object sender,
WorkflowTerminatedEventArgs e)<br />
        {<br />
            waitHandle.Set();<br />
        };</font>
        </p>
        <p>
          <font face="Courier New">        // create workflow
instance with the specified parameters<br />
        WorkflowInstance instance =<br />
           workflowRuntime.CreateWorkflow(typeof(MyWorkflow));<br />
        instance.Start();</font>
        </p>
        <p>
          <font face="Courier New">        waitHandle.WaitOne();<br />
    }    
<br />
}</font>
        </p>
        <p>
An important thing in the specified sample is that the <font face="Courier New">System.Workflow.Runtime.WorkflowRuntime</font> instance
is static to the service implementation class. This is a requirement, since the workflow
runtime can only get loaded once per appdomain. If this is not the case you will get
an exception during the second invocation of the workflow.
</p>
        <p>
If you are using any additional workflow runtime services, like persistence, tracking
or your own communication service to communicate with the workflow you will need to
track that the services get loaded once only. Here's the example:
</p>
        <p>
          <font face="Courier New">[WebService(Namespace = "</font>
          <font face="Courier New">http://webservices.gama-system.com/</font>
          <font face="Courier New">")]<br />
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />
public class WorkflowService : System.Web.Services.WebService<br />
{<br />
    // workflow runtime<br />
    <strong>private static WorkflowRuntime workflowRuntime = new WorkflowRuntime();</strong><br />
    
<br />
    </font>
          <font face="Courier New">// services added<br />
    <strong>private static bool booServicesAdded = false;</strong></font>
        </p>
        <p>
          <font face="Courier New">    // communication service<br />
    <strong>private static CommunicationService objComm = new CommunicationService();<br /></strong><br /></font>
          <font face="Courier New">    [WebMethod]<br />
    public void SendOrder(Order order)<br />
    {<br /></font>
          <font face="Courier New">        <strong>//
add communication service<br />
        if (!booServicesAdded)<br />
        {<br />
            ExternalDataExchangeService
externalService =<br />
              
new ExternalDataExchangeService();<br />
            workflowRuntime.AddService(externalService);<br />
            externalService.AddService(objComm);<br />
            booServiceAdded
= true;<br />
        }<br /></strong><br /></font>
          <font face="Courier New">        AutoResetEvent
waitHandle = new AutoResetEvent(false);<br />
        workflowRuntime.WorkflowCompleted +=<br />
           delegate(object sender,
WorkflowCompletedEventArgs e)<br />
        {<br />
            waitHandle.Set();<br />
        };<br />
        
<br />
        workflowRuntime.WorkflowTerminated +=<br />
           delegate(object sender,
WorkflowTerminatedEventArgs e)<br />
        {<br />
            waitHandle.Set();<br />
        };</font>
        </p>
        <p>
          <font face="Courier New">        // create workflow
instance with the specified parameters<br />
        WorkflowInstance instance =<br />
           workflowRuntime.CreateWorkflow(typeof(MyWorkflow));<br />
        instance.Start();</font>
        </p>
        <p>
          <font face="Courier New">        waitHandle.WaitOne();<br />
    }    
<br />
}</font>
        </p>
        <p>
This adds the required services only during the first invocation of a web service.
Since workflow runtime is a static class the services get persisted during all subsequent
service calls. A boolean variable <font face="Courier New">booServicesAdded</font> is
responsible for flag storage.
</p>
        <img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=21c95c2c-63d7-44f6-8357-1be0ecb6f264" />
      </body>
      <title>Windows Workflow Foundation: Exposing Workflows as Services</title>
      <guid isPermaLink="false">https://www.request-response.com/blog/PermaLink,guid,21c95c2c-63d7-44f6-8357-1be0ecb6f264.aspx</guid>
      <link>https://www.request-response.com/blog/PermaLink,guid,21c95c2c-63d7-44f6-8357-1be0ecb6f264.aspx</link>
      <pubDate>Wed, 10 May 2006 08:55:37 GMT</pubDate>
      <description>&lt;p&gt;
There are currently a couple of options to expose a Windows Workflow as as service.
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
There is a native option to publish a developed Workflow Library project as a ASP
.NET Web Service (ASMX). 
&lt;li&gt;
You can host it yourself (ASMX, WCF) 
&lt;li&gt;
&lt;a href="http://www.softwaremaker.net/blog/"&gt;William Tay&lt;/a&gt; is doing excellent work
towards &lt;a href="http://www.softwaremaker.net/blog/HookingAWorkflowIntoYourWCFDispatcher.aspx"&gt;hosting
a workflow inside the WCF service pipeline&lt;/a&gt;&amp;nbsp;(WCF) 
&lt;li&gt;
&lt;a href="http://www.codeproject.com/script/profile/whos_who.asp?vt=arts&amp;amp;id=24570"&gt;Roman
Kiss&lt;/a&gt; created a &lt;a href="http://windowscommunication.net/ControlGallery/ControlDetail.aspx?Control=2278&amp;amp;tabindex=2"&gt;static
WorkflowInvoker class&lt;/a&gt;, which does all the heavy liting for you, if you want to
host your workflow inside the WCF service method (WCF)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
I'm going to focus on Ad 1 and Ad 2 in this post.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Ad 1:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
There's an option to host your workflow library inside a web service by using a "Publish
as a Web Service" option inside Visual Studio 2005. This creates a separate ASP .NET
Web Service project inside your current solution, which you can later manually or
automatically publish as a web site to your IIS of choice.
&lt;/p&gt;
&lt;p&gt;
The are &lt;em&gt;two major downsides&lt;/em&gt; to this story. The first is&amp;nbsp;that this gives
you practically no control over how&amp;nbsp;the web service is created. Second downside,
while documented, is that the current implementation of &lt;font face="Courier New"&gt;System.Workflow.Runtime.WorkflowWebHostingModule&lt;/font&gt; works
in particular ways with the workflow persistence story.
&lt;/p&gt;
&lt;p&gt;
Let's assume we have to following interface defined for this web service:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;interface &lt;strong&gt;IServiceInterface&lt;br&gt;
&lt;/strong&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;{&lt;br&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;void &lt;strong&gt;SendOrder&lt;/strong&gt;(Order
order);&lt;br&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Order &lt;strong&gt;GetOrder&lt;/strong&gt;(Guid
guidOrder);&lt;br&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;int &lt;strong&gt;GetOrderStatus&lt;/strong&gt;(Guid
guidOrder);&lt;br&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
What happens is (request number 1):
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
You publish your workflow as a web service 
&lt;li&gt;
You hit the service endpoint with a browser 
&lt;li&gt;
Workflow instance gets created, is run and returns a result 
&lt;li&gt;
At this time the workflow runtime (System.Workflow.Runtime.WorkflowRuntime instance)
creates a workflow instance and runs it. Since workflow completes succesfully it destroys
the instance at the end of execution. 
&lt;li&gt;
Workflow runtime returns a cookie with the workflow instance back to the browser and
since IE's default setting is to accept cookies, it is written to the client's disk&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
All good, right?
&lt;/p&gt;
&lt;p&gt;
Actually, what happens&amp;nbsp;during request number 2?
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
You hit the endpoint &lt;strong&gt;again&lt;/strong&gt; 
&lt;li&gt;
IE knows that the site has a persisted cookie, so it sends it bundled with the SOAP
request 
&lt;li&gt;
Workflow runtime sees it and tries to load the specified workflow instance 
&lt;li&gt;
This instance is long gone, it does not exist in memory (it has been destroyed, remember?),
so workflow runtime tries to rehydrate it from a persistence store. If there is a
persistence store defined it goes there (most probably &lt;font face="Courier New"&gt;WorkflowPersistenceStore&lt;/font&gt; in
SQL Server) and correctly identifies that the workflow instance is not present, so
it &lt;strong&gt;fails&lt;/strong&gt; with &lt;font face="Courier New"&gt;'Workflow with id&amp;nbsp;&amp;lt;GUID&amp;gt;
not found in state persistence store.'&lt;/font&gt;.&amp;nbsp;If the persistence store is not
defined for this workflow it &lt;strong&gt;fails&lt;/strong&gt; with &lt;font face="Courier New"&gt;'The
workflow hosting environment does not have a persistence service as required by an
operation on the workflow instance &amp;lt;GUID&amp;gt;.'&lt;/font&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
And all this is actually the expected behavior if you think hard enough. Workaround?
Hit the endpoint with a newly loaded&amp;nbsp;IE window. It works every time, since a
cookie with an instance ID is not present.
&lt;/p&gt;
&lt;p&gt;
Another thing to mention here is that this issue does not manifest itself if you hit
the endpoint programatically using the web service proxy, unless you are using a &lt;font face="Courier New"&gt;CookieContainer&lt;/font&gt; class
to cache the returning cookies.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Ad 2:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Hosting a Windows Workflow manually is another option, which gives you more flexibility
towards the service detail tweeking.
&lt;/p&gt;
&lt;p&gt;
You can host it using the following code:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;[WebService(Namespace = "&lt;/font&gt;&lt;font face="Courier New"&gt;http://webservices.gama-system.com/&lt;/font&gt;&lt;font face="Courier New"&gt;")]&lt;br&gt;
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]&lt;br&gt;
public class&amp;nbsp;WorkflowService : System.Web.Services.WebService&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // workflow runtime&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;private static WorkflowRuntime workflowRuntime = new WorkflowRuntime();&lt;/strong&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [WebMethod]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public&amp;nbsp;void SendOrder(Order order)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AutoResetEvent
waitHandle = new AutoResetEvent(false);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workflowRuntime.WorkflowCompleted +=&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delegate(object sender,
WorkflowCompletedEventArgs e)&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; waitHandle.Set();&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; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workflowRuntime.WorkflowTerminated +=&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delegate(object sender,
WorkflowTerminatedEventArgs e)&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; waitHandle.Set();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // create workflow
instance with the specified parameters&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WorkflowInstance instance =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workflowRuntime.CreateWorkflow(typeof(MyWorkflow));&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; instance.Start();&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; waitHandle.WaitOne();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
An important thing in the specified sample is that the &lt;font face="Courier New"&gt;System.Workflow.Runtime.WorkflowRuntime&lt;/font&gt; instance
is static to the service implementation class. This is a requirement, since the workflow
runtime can only get loaded once per appdomain. If this is not the case you will get
an exception during the second invocation of the workflow.
&lt;/p&gt;
&lt;p&gt;
If you are using any additional workflow runtime services, like persistence, tracking
or your own communication service to communicate with the workflow you will need to
track that the services get loaded once only. Here's the example:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;[WebService(Namespace = "&lt;/font&gt;&lt;font face="Courier New"&gt;http://webservices.gama-system.com/&lt;/font&gt;&lt;font face="Courier New"&gt;")]&lt;br&gt;
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]&lt;br&gt;
public class&amp;nbsp;WorkflowService : System.Web.Services.WebService&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // workflow runtime&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;private static WorkflowRuntime workflowRuntime = new WorkflowRuntime();&lt;/strong&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font face="Courier New"&gt;// services added&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;private static bool booServicesAdded = false;&lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // communication&amp;nbsp;service&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;private static CommunicationService objComm = new CommunicationService();&lt;br&gt;
&lt;/strong&gt;
&lt;br&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [WebMethod]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public&amp;nbsp;void SendOrder(Order order)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;//
add communication service&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!booServicesAdded)&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; ExternalDataExchangeService
externalService =&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;&amp;nbsp;
new ExternalDataExchangeService();&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; workflowRuntime.AddService(externalService);&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; externalService.AddService(objComm);&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; booServiceAdded
= true;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&lt;/strong&gt;
&lt;br&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AutoResetEvent
waitHandle = new AutoResetEvent(false);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workflowRuntime.WorkflowCompleted +=&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delegate(object sender,
WorkflowCompletedEventArgs e)&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; waitHandle.Set();&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; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workflowRuntime.WorkflowTerminated +=&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delegate(object sender,
WorkflowTerminatedEventArgs e)&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; waitHandle.Set();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // create workflow
instance with the specified parameters&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WorkflowInstance instance =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workflowRuntime.CreateWorkflow(typeof(MyWorkflow));&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; instance.Start();&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; waitHandle.WaitOne();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
This adds the required services only during the first invocation of a web service.
Since workflow runtime is a static class the services get persisted during all subsequent
service calls. A boolean variable &lt;font face="Courier New"&gt;booServicesAdded&lt;/font&gt; is
responsible for flag storage.
&lt;/p&gt;
&lt;img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=21c95c2c-63d7-44f6-8357-1be0ecb6f264" /&gt;</description>
      <comments>https://www.request-response.com/blog/CommentView,guid,21c95c2c-63d7-44f6-8357-1be0ecb6f264.aspx</comments>
      <category>Web Services</category>
      <category>.NET 3.0 - WCF</category>
      <category>.NET 3.0 - WF</category>
    </item>
    <item>
      <trackback:ping>https://www.request-response.com/blog/Trackback.aspx?guid=3d0f83e3-8d99-437f-b8aa-c4046cbc35dc</trackback:ping>
      <pingback:server>https://www.request-response.com/blog/pingback.aspx</pingback:server>
      <pingback:target>https://www.request-response.com/blog/PermaLink,guid,3d0f83e3-8d99-437f-b8aa-c4046cbc35dc.aspx</pingback:target>
      <dc:creator>Matevz Gacnik</dc:creator>
      <wfw:comment>https://www.request-response.com/blog/CommentView,guid,3d0f83e3-8d99-437f-b8aa-c4046cbc35dc.aspx</wfw:comment>
      <wfw:commentRss>https://www.request-response.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=3d0f83e3-8d99-437f-b8aa-c4046cbc35dc</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
If you are running WWF (Windows Workflow Foundation, part of WinFX) on a x64 box,
and have problems debugging workflows, stop.
</p>
        <p>
It's currently not supported. It should, but does not work yet. This <em>should</em> be
fixed already, but it's not. And it <em>will probably</em> get fixed in
the next CTP drop.
</p>
        <p>
There is a workaround though:
</p>
        <ol>
          <li>
Enter Configuration Manager (Build/Configuration Manager) 
</li>
          <li>
Select the active solution platform drop down, select New... 
</li>
          <li>
Select x86 platform 
</li>
          <li>
Hit OK and try debugging again</li>
        </ol>
        <p>
This will make sure that you are running your solution debugging under x86
mode and thus allow you to set breakpoints and debug your code.
</p>
        <img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=3d0f83e3-8d99-437f-b8aa-c4046cbc35dc" />
      </body>
      <title>WWF on x64 Platform</title>
      <guid isPermaLink="false">https://www.request-response.com/blog/PermaLink,guid,3d0f83e3-8d99-437f-b8aa-c4046cbc35dc.aspx</guid>
      <link>https://www.request-response.com/blog/PermaLink,guid,3d0f83e3-8d99-437f-b8aa-c4046cbc35dc.aspx</link>
      <pubDate>Tue, 14 Mar 2006 22:09:15 GMT</pubDate>
      <description>&lt;p&gt;
If you are running WWF (Windows Workflow Foundation, part of WinFX) on a x64 box,
and have problems debugging workflows, stop.
&lt;/p&gt;
&lt;p&gt;
It's currently not supported. It should, but does not work yet. This &lt;em&gt;should&lt;/em&gt; be
fixed already, but it's not. And it&amp;nbsp;&lt;em&gt;will probably&lt;/em&gt;&amp;nbsp;get fixed in
the next CTP drop.
&lt;/p&gt;
&lt;p&gt;
There is a workaround though:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Enter Configuration Manager (Build/Configuration Manager) 
&lt;li&gt;
Select the active solution platform drop down, select New... 
&lt;li&gt;
Select x86 platform 
&lt;li&gt;
Hit OK and try debugging again&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
This will make sure that&amp;nbsp;you&amp;nbsp;are running your solution debugging under x86
mode and thus allow you to set breakpoints and debug your code.
&lt;/p&gt;
&lt;img width="0" height="0" src="https://www.request-response.com/blog/aggbug.ashx?id=3d0f83e3-8d99-437f-b8aa-c4046cbc35dc" /&gt;</description>
      <comments>https://www.request-response.com/blog/CommentView,guid,3d0f83e3-8d99-437f-b8aa-c4046cbc35dc.aspx</comments>
      <category>.NET 3.0 - General</category>
      <category>.NET 3.0 - WF</category>
    </item>
  </channel>
</rss>