<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sander van Vliet &#187; WF</title>
	<atom:link href="http://barad-dur.nl/category/net/wf/feed/" rel="self" type="application/rss+xml" />
	<link>http://barad-dur.nl</link>
	<description>Land Rovers, .Net en meer!</description>
	<lastBuildDate>Fri, 11 Nov 2011 07:46:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Custom WSDL for WCF Workflow Service</title>
		<link>http://barad-dur.nl/net/wcf-workflow-service/</link>
		<comments>http://barad-dur.nl/net/wcf-workflow-service/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 09:17:52 +0000</pubDate>
		<dc:creator>Sander</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[C# 4.0]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[WF]]></category>

		<guid isPermaLink="false">http://barad-dur.nl/?p=165</guid>
		<description><![CDATA[I&#8217;m currently working on a webservice layer for our main application so we can interface with our existing BizTalk applications. Because I like using new technologies I&#8217;ve decided to use WCF Workflow services to implement the logic of these services. With WF4 and the FlowDiagram features it&#8217;s very easy to do this and really, really <a href="http://barad-dur.nl/net/wcf-workflow-service/" class="more-link">Meer &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently working on a webservice layer for our main application so we can interface with our existing BizTalk applications. Because I like using new technologies I&#8217;ve decided to use WCF Workflow services to implement the logic of these services. With WF4 and the FlowDiagram features it&#8217;s very easy to do this and really, really quick to build the services.</p>
<p>One slight problem I&#8217;ve discovered is that the C# types we use in the ReceiveRequest activity are generated from a custom XSD and the WSDL generated by the workflow service doesn&#8217;t reference that schema but generates a new one. Normally this isn&#8217;t that much of a problem, simply create a custom WSDL and set the externalMetadataLocation option in the web.config:</p>
<pre>&lt;behavior name="MyServiceBehavior"&gt;
   &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
   &lt;serviceMetadata httpGetEnabled="true" externalMetadataLocation="../MyService.wsdl" /&gt;
&lt;/behavior&gt;</pre>
<p>Contrary to popular belief, this doesn&#8217;t work! The workflow service still gives it&#8217;s WSDL as being MyService.xamlx?wsdl instead of the custom WSDL. After some Google-ing (is that a word?) I found that there was something missing: a binding. More specific: a mexHttpBinding. It seems that without specifying the Metadata Exchange the workflow service will continue to provide it&#8217;s own idea of the WSDL and ignores the WSDL specified in the externalMetadataLocation.</p>
<p>Fortunately the fix is easy. Add a new endpoint to the service configuration that uses the mexHttpBinding:</p>
<pre>&lt;service name="MyService" behaviorConfiguration="MyServiceBehavior"&gt;
   &lt;endpoint binding="mexHttpBinding" contract="IMetadataExchange" address="mex" /&gt;
&lt;/service&gt;</pre>
<p>After adding this and refreshing the workflow service in the browser it now correctly shows the custom WSDL!</p>
]]></content:encoded>
			<wfw:commentRss>http://barad-dur.nl/net/wcf-workflow-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

