<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>BizTalk lessons from the field : WCF</title><link>http://blogs.msdn.com/nabeelp/archive/tags/WCF/default.aspx</link><description>Tags: WCF</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Obscure Error: AddressFilter mismatch at the EndpointDispatcher</title><link>http://blogs.msdn.com/nabeelp/archive/2008/03/07/obscure-error-addressfilter-mismatch-at-the-endpointdispatcher.aspx</link><pubDate>Fri, 07 Mar 2008 18:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8100727</guid><dc:creator>Nabeel Prior</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/nabeelp/comments/8100727.aspx</comments><wfw:commentRss>http://blogs.msdn.com/nabeelp/commentrss.aspx?PostID=8100727</wfw:commentRss><description>&lt;P&gt;While testing the WCF-WSHttp receive adapter this week I ran in this very interesting, and rather obscurely worded&amp;nbsp;error:&lt;/P&gt;
&lt;P class=CodeSection&gt;&lt;FONT face="Courier, Courier New"&gt;The message with To '' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher.&amp;nbsp; Check that the sender and receiver's EndpointAddresses agree.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The objective of this integration was to expose a service through which we would be able to receive a message from an IBM WebSphere Message Broker implementation initially.&amp;nbsp; The intention was that other applications and back-end systems would also be able to utilise this service at a later stage.&amp;nbsp; It had therefore been decided way back in the design stage of the project that we would accomplish this by using the SOAP 1.2 protocol for receiving messages into BizTalk.&amp;nbsp; To implement this on the BizTalk side we published the schema for the message we were expecting as a WCF service, and created the matching receive location.&amp;nbsp; My first mistake was that I thought we could use the WCF-BasicHttp adapter, as the only requirement was that the service needed to adhere to the WS-BasicProfile standard.&amp;nbsp; What I did not know at the time was that the BasicHttp adapter only supports SOAP 1.1, and to use SOAP 1.2 you have to use the WCF-WSHttp adapter.&lt;/P&gt;
&lt;P&gt;After using the command line utility discussed in a &lt;A class="" href="http://blogs.msdn.com/nabeelp/archive/2008/02/26/Switching-a-Published-WCF-Service-between-WSHttp-and-BasicHttp.aspx" mce_href="http://blogs.msdn.com/nabeelp/archive/2008/02/26/Switching-a-Published-WCF-Service-between-WSHttp-and-BasicHttp.aspx"&gt;previous post&lt;/A&gt; to recreate the service and update the receive location, I figured everything would&amp;nbsp;be ready and I started to test the service via SOAP 1.2 again.&amp;nbsp; That was when this rather obscure error was returned in the SOAP response.&amp;nbsp; The actual response looked something like this:&lt;/P&gt;
&lt;P class=CodeSection&gt;&lt;FONT face="Courier, Courier New"&gt;&amp;lt;s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;s:Header&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a:Action s:mustUnderstand="1"&amp;gt;http://www.w3.org/2005/08/addressing/soap/fault&amp;lt;/a:Action&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/s:Header&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;s:Body&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Fault&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Code&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;s:Value&amp;gt;s:Sender&amp;lt;/s:Value&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;s:Subcode&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;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Value&amp;gt;a:DestinationUnreachable&amp;lt;/s:Value&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;/s:Subcode&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/s:Code&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Reason&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;s:Text xml:lang="en-ZA"&amp;gt;The message with To '' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher.&amp;nbsp; Check that the sender and receiver's EndpointAddresses agree.&amp;lt;/s:Text&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/s:Reason&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/s:Fault&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/s:Body&amp;gt;&lt;BR&gt;&amp;lt;/s:Envelope&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;After scouring the web for an explanation I came across a number of articles that discussed WCF coding changes and endpoint behaviour changes that would remedy the error.&amp;nbsp; The only problem with that is that we do not have access to making code changes, and changing the endpoint behaviour did not make sense either.&amp;nbsp; I also wanted to stay away from implementing custom WCF bindings, as this is supposed to be "out-of-the-box" functionality.&lt;/P&gt;
&lt;P&gt;Eventually I came across this article: &lt;A href="http://msdn2.microsoft.com/en-us/library/bb246105.aspx"&gt;http://msdn2.microsoft.com/en-us/library/bb246105.aspx&lt;/A&gt;, which focuses on using incoming SOAP headers, and&amp;nbsp;I noticed the "To" element within the SOAP Header section.&amp;nbsp; With a little more reading and surfing I came to realise that the WSHttp adapter utilises the WS-Addressing standard to identify the receive location to which the message needs to be submitted.&amp;nbsp; With this knowledge in hand I added the following section to the SOAP message I was sending to BizTalk:&lt;/P&gt;
&lt;P class=CodeSection&gt;&lt;FONT face="Courier, Courier New"&gt;&amp;lt;soap:Header&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;To soap:mustUnderstand="1" xmlns="http://www.w3.org/2005/08/addressing"&amp;gt;http://server1/virtualDir/MyService.svc&amp;lt;/To&amp;gt;&lt;BR&gt;&amp;lt;/soap:Header&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The addressing namespace can, of course go into the "Envelope" declaration of the SOAP message, but for simplicity sake I am reflecting it as shown here.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The URI that is put into the To element is essentially the URI used to get to the service in the first place.&amp;nbsp; A few interesting observations about this URI:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The value of the server name portion of the URI ("server1" in the snippet above) is immaterial.&lt;/LI&gt;
&lt;LI&gt;The portion of the URI after the server name, up to and including the ".svc" must match the URI in your receive location.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;After adding this section to the SOAP message and submitting it to BizTalk the message was received and processed successfully.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8100727" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/nabeelp/archive/tags/BizTalk/default.aspx">BizTalk</category><category domain="http://blogs.msdn.com/nabeelp/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/nabeelp/archive/tags/SOAP/default.aspx">SOAP</category></item><item><title>Switching a Published WCF Service between WSHttp and BasicHttp</title><link>http://blogs.msdn.com/nabeelp/archive/2008/02/26/Switching-a-Published-WCF-Service-between-WSHttp-and-BasicHttp.aspx</link><pubDate>Tue, 26 Feb 2008 21:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7822074</guid><dc:creator>Nabeel Prior</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/nabeelp/comments/7822074.aspx</comments><wfw:commentRss>http://blogs.msdn.com/nabeelp/commentrss.aspx?PostID=7822074</wfw:commentRss><description>&lt;P&gt;When&amp;nbsp;using the BizTalk WCF Service Publishing Wizard to create WCF services a number of files and directories are created in the stipulated virtual directory folder.&amp;nbsp; The directory structure created is shown below, with a brief statement as to what is in each directory:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Root Directory: contains the .svc files for each service that has been published, and the web.config file.&amp;nbsp; &lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;The App_Data directory contains the schemas for those services that have been published. &lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;The Temp sub-directory contains the binding file for the services and the WcfServiceDescription.xml file, which contains the various properties entered into the WCF Publishing Wizard.&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;
&lt;P&gt;At a customer recently there was a requirement to take these published services and change them from using the WCF-WSHttp adapter to using the WCF-BasicHttp adapter.&amp;nbsp; One option was to republish the WCF services, but this was quickly discarded as there were a large number of services.&amp;nbsp; As BizTalk does not include a command line version of the WCF Publishing Wizard in the installation the customer was in the process of developing their own WCF publishing service, using the WcfServiceDescription.xml file located in the Temp directory.&amp;nbsp; After pointing out to them the availability of an existing command line utility, as docmented&amp;nbsp;at&amp;nbsp;&lt;A href="http://technet.microsoft.com/en-us/library/bb245933.aspx" mce_href="http://technet.microsoft.com/en-us/library/bb245933.aspx"&gt;http://technet.microsoft.com/en-us/library/bb245933.aspx&lt;/A&gt;, they decided to use this instead.&amp;nbsp; Using the command line tool, and by setting the "AdapterName"&amp;nbsp;argument to "WCF-BasicHttp", they were able to very quickly then republish their endpoints and change all their receive locations to use the WCF-BasicHttp adapter.&lt;/P&gt;
&lt;P&gt;There are a&amp;nbsp;few things to be aware of when using this command-line utility, however:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The first argument for the utility is "PathName", which is required to be the "Path and file name of the BizTalk assembly (*.dll) or the WCF service description (*.xml) file".&amp;nbsp; If you are using the utility to publish an orchestration then the path to the BizTalk assembly can be used, but if you are publishing schemas using the path to the BizTalk assembly will result in the utility completing successfully, but there will be no .svc files in the root of the directory, and there will be no schema files in the App_Data directory.&amp;nbsp; When publishing a schema as a WCF end-point you will need to use the path to the WCF service description file, which is the WcfServiceDescription.xml file found in the Temp directory of a published WCF end-point.&lt;/LI&gt;
&lt;LI&gt;As the utility overwrites the contents of the virtual directory, when the -Overwrite argument is used, any changes you made to the web.config file will be lost.&amp;nbsp; So, don't forget to add the &amp;lt;trust level="Full" /&amp;gt; text just before the &amp;lt;/system.web&amp;gt; text in the web.config file after the utility has completed its execution.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;This tool is available for download from: &lt;A href="http://go.microsoft.com/fwlink/?LinkId=92955" mce_href="http://go.microsoft.com/fwlink/?LinkId=92955"&gt;http://go.microsoft.com/fwlink/?LinkId=92955&lt;/A&gt;, and the documentation for it is located at: &lt;A href="http://technet.microsoft.com/en-us/library/bb245933.aspx" mce_href="http://technet.microsoft.com/en-us/library/bb245933.aspx"&gt;http://technet.microsoft.com/en-us/library/bb245933.aspx&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7822074" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/nabeelp/archive/tags/BizTalk/default.aspx">BizTalk</category><category domain="http://blogs.msdn.com/nabeelp/archive/tags/WCF/default.aspx">WCF</category></item></channel></rss>