<?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>Semaphore Media and Development</title>
	<atom:link href="http://www.semaphoremd.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.semaphoremd.com</link>
	<description>...at the crossroad of creativity and technology...</description>
	<lastBuildDate>Wed, 23 Nov 2011 18:01:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>deploy Visual Studio database project through TFS 2010 build</title>
		<link>http://www.semaphoremd.com/2011/11/18/deploy-visual-studio-database-project-through-tfs-2010-build/</link>
		<comments>http://www.semaphoremd.com/2011/11/18/deploy-visual-studio-database-project-through-tfs-2010-build/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 01:53:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[TFS]]></category>

		<guid isPermaLink="false">http://www.semaphoremd.com/?p=87</guid>
		<description><![CDATA[I found a great article on how to configure auto deploy VS database project after build using TFS 2010. http://www.codewrecks.com/blog/index.php/2010/01/04/deploy-a-database-project-with-tfs-build-2010/ One more note: If you want to manually execute the deployment script generated by MSBuild using SQL Mgmt Studio, make sure to set it to SQL Command Mode first or else the :setvar line will [...]]]></description>
			<content:encoded><![CDATA[<p>I found a great article on how to configure auto deploy VS database project after build using TFS 2010.</p>
<p>http://www.codewrecks.com/blog/index.php/2010/01/04/deploy-a-database-project-with-tfs-build-2010/</p>
<p>One more note: If you want to manually execute the deployment script generated by MSBuild using SQL Mgmt Studio, make sure to set it to SQL Command Mode first or else the :setvar line will error out.  To set the mode, goto Query->SQLCMD mode in SQL Mgmt Studio&#8217;s menu. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.semaphoremd.com/2011/11/18/deploy-visual-studio-database-project-through-tfs-2010-build/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MQSC adapter not available in Biztalk Administration console</title>
		<link>http://www.semaphoremd.com/2011/11/17/mqsc-adapter-not-available-in-biztalk-administration-console/</link>
		<comments>http://www.semaphoremd.com/2011/11/17/mqsc-adapter-not-available-in-biztalk-administration-console/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 20:55:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[MQSC]]></category>

		<guid isPermaLink="false">http://www.semaphoremd.com/?p=85</guid>
		<description><![CDATA[While working on a small POC project using BizTalk 2009, I encountered an issue where MQSC adapter isn&#8217;t showing up in BizTalk Admin Console. By following the steps described in the blog post I was able to fix the issue. http://blog.nimbo.com/biztalk-2009-websphere-mq-communication-on-windows-2008-64-bit/ Apparently the adapter isn&#8217;t getting registered under WOW6432Node in registry. Reinstall WebSphere MQ (client-based) [...]]]></description>
			<content:encoded><![CDATA[<p>While working on a small POC project using BizTalk 2009, I encountered an issue where MQSC adapter isn&#8217;t showing up in BizTalk Admin Console.  By following the steps described in the blog post I was able to fix the issue.</p>
<p>http://blog.nimbo.com/biztalk-2009-websphere-mq-communication-on-windows-2008-64-bit/</p>
<p>Apparently the adapter isn&#8217;t getting registered under WOW6432Node in registry.  Reinstall WebSphere MQ (client-based) option and then import the following reg file solved the issue. </p>
<p>Windows Registry Editor Version 5.00</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID\{CF8B4D15-5D2B-4c62-90DB-16804D2454B9}]<br />
@=&#8221;MQSC Adapter Class&#8221;<br />
&#8220;AppID&#8221;=&#8221;{401D2C40-DAA9-4a63-8D42-9BF98B04F616}&#8221;</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID\{CF8B4D15-5D2B-4c62-90DB-16804D2454B9}\BizTalk]<br />
@=&#8221;BizTalk&#8221;<br />
&#8220;TransportType&#8221;=&#8221;MQSC&#8221;<br />
&#8220;Constraints&#8221;=dword:00003d0b<br />
&#8220;ReceiveLocation_PageProv&#8221;=&#8221;{2DE93EE6-CB01-4007-93E9-C3D71689A280}&#8221;<br />
&#8220;TransmitLocation_PageProv&#8221;=&#8221;{2DE93EE6-CB01-4007-93E9-C3D71689A282}&#8221;<br />
&#8220;OutboundProtocol_PageProv&#8221;=&#8221;{2DE93EE6-CB01-4007-93E9-C3D71689A283}&#8221;<br />
&#8220;OutboundEngineCLSID&#8221;=&#8221;{6811E17F-A4C2-44BB-B4D5-D69962E58E87}&#8221;<br />
&#8220;InboundEngineCLSID&#8221;=&#8221;{538F8B3D-EE7B-4459-A123-45CD5C3B671B}&#8221;<br />
&#8220;InboundTypeName&#8221;=&#8221;Microsoft.BizTalk.Adapter.Mqsc.MqscReceiver, Microsoft.BizTalk.Adapter.MQSC, Version=7.0.2300.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null&#8221;<br />
&#8220;InboundAssemblyPath&#8221;=&#8221;"<br />
&#8220;OutboundTypeName&#8221;=&#8221;Microsoft.BizTalk.Adapter.Mqsc.MqscTransmitter, Microsoft.BizTalk.Adapter.MQSC, Version=7.0.2300.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null&#8221;<br />
&#8220;OutboundAssemblyPath&#8221;=&#8221;"<br />
&#8220;PropertyNameSpace&#8221;=&#8221;http://schemas.microsoft.com/BizTalk/2003/mqs-properties&#8221;<br />
&#8220;ProtocolAlias&#8221;=&#8221;mqsc://&#8221;<br />
&#8220;ReceiveHandlerPropertiesXML&#8221;=&#8221;<CustomProps><AdapterConfig vt=\"8\"/></CustomProps>&#8221;<br />
&#8220;SendHandlerPropertiesXML&#8221;=&#8221;<CustomProps><AdapterConfig vt=\"8\"/></CustomProps>&#8221;<br />
&#8220;ReceiveLocationPropertiesXML&#8221;=&#8221;<CustomProps><AdapterConfig vt=\"8\"/></CustomProps>&#8221;<br />
&#8220;SendLocationPropertiesXML&#8221;=&#8221;<CustomProps><AdapterConfig vt=\"8\"/></CustomProps>&#8221;<br />
&#8220;AliasesXML&#8221;=&#8221;<AdapterAliasList><AdapterAlias>mqsc://</AdapterAlias></AdapterAliasList>&#8221;<br />
&#8220;AdapterMgmtTypeName&#8221;=&#8221;Microsoft.BizTalk.Adapter.Mqsc.MqscAdapterManagement&#8221;<br />
&#8220;AdapterMgmtAssemblyPath&#8221;=&#8221;C:\\Program Files\\Microsoft BizTalk Adapters for Host Systems 2.0\\system\\Microsoft.BizTalk.Adapter.MQSCAdmin.dll&#8221;</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID\{CF8B4D15-5D2B-4c62-90DB-16804D2454B9}\Implemented Categories]</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID\{CF8B4D15-5D2B-4c62-90DB-16804D2454B9}\Implemented Categories\{7F46FC3E-3C2C-405B-A47F-8D17942BA8F9}]<br />
@=&#8221;"</p>
]]></content:encoded>
			<wfw:commentRss>http://www.semaphoremd.com/2011/11/17/mqsc-adapter-not-available-in-biztalk-administration-console/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>generating polling statement schema via WCF-Oracle DB adapter</title>
		<link>http://www.semaphoremd.com/2011/08/02/generating-polling-statement-schema-via-wcf-oracle-db-adapter/</link>
		<comments>http://www.semaphoremd.com/2011/08/02/generating-polling-statement-schema-via-wcf-oracle-db-adapter/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 00:16:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[polling]]></category>
		<category><![CDATA[schema]]></category>

		<guid isPermaLink="false">http://www.semaphoremd.com/?p=82</guid>
		<description><![CDATA[How to generate a polling statement schema using adapter wizard: 1. in the binding properties tab of wizard, set: InboundOperationType: Polling EnableBizTalkCompatibilityMode: True PolledDataAvailableStatement PollingStatement: 2. Click connect and select &#8220;Service (Inbound Operations)&#8221; 3. Instead of clicking on a schema, click on the top branch i.e &#8220;/&#8221; 4. In the &#8220;Available categories and operations&#8221; box, [...]]]></description>
			<content:encoded><![CDATA[<p>How to generate a polling statement schema using adapter wizard:</p>
<p>1. in the binding properties tab of wizard, set:<br />
      InboundOperationType: Polling<br />
      EnableBizTalkCompatibilityMode: True<br />
      PolledDataAvailableStatement <enter the SELECT COUNT(*) statement><br />
      PollingStatement: <enter the select statement></p>
<p>2. Click connect and select &#8220;Service (Inbound Operations)&#8221;</p>
<p>3. Instead of clicking on a schema, click on the top branch i.e &#8220;/&#8221;</p>
<p>4. In the &#8220;Available categories and operations&#8221; box, scroll all the way down, select &#8220;POLLINGSTMT&#8221; operation, and click Add button.</p>
<p>5. Click OK to generate the schema</p>
]]></content:encoded>
			<wfw:commentRss>http://www.semaphoremd.com/2011/08/02/generating-polling-statement-schema-via-wcf-oracle-db-adapter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing 32-bit and 64-bit Oracle 11g R2 ODAC to work with BizTalk 2010 Oracle adapters</title>
		<link>http://www.semaphoremd.com/2011/05/03/installing-32-bit-and-64-bit-oracle-11g-r2-odac-to-work-with-biztalk-2010-oracle-adapters/</link>
		<comments>http://www.semaphoremd.com/2011/05/03/installing-32-bit-and-64-bit-oracle-11g-r2-odac-to-work-with-biztalk-2010-oracle-adapters/#comments</comments>
		<pubDate>Tue, 03 May 2011 18:02:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.semaphoremd.com/?p=76</guid>
		<description><![CDATA[Installing Oracle&#8217;s ODAC drivers can be a struggle since the installation guide, from both Oracle and Microsoft, does not spell out the gotcha&#8217;s. After a few days of testing, we finally got it right. Here are the steps taken to ensure that both versions are supported by BizTalk 2010. 1. Download both 32-bit and 64-bit [...]]]></description>
			<content:encoded><![CDATA[<p>Installing Oracle&#8217;s ODAC drivers can be a struggle since the installation guide, from both Oracle and Microsoft, does not spell out the gotcha&#8217;s.  After a few days of testing, we finally got it right.  Here are the steps taken to ensure that both versions are supported by BizTalk 2010.</p>
<p>1. Download both 32-bit and 64-bit of Oracle Instant Client (http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html)</p>
<p>2. First install the 64-bit version.  This is important!  If you install 32-bit version version first then you&#8217;ll run into a slew of errors during installation.</p>
<p>3. When prompted for installation options, choose custom install.</p>
<p>4. Select the following components:<br />
        MTC<br />
        Oracle Net<br />
        Admin Assistant<br />
        Oracle Counter for Windows Performance<br />
        OLE<br />
        OLE DB<br />
        ODBC<br />
        Data Provider for .NET</p>
<p>5. After 64-bit client is installed, install 32-bit client next.</p>
<p>6. For 32-bit client install, choose the same components as 64-bit install.  Make sure to install to a different file folder than the 64-bit folder.</p>
<p>7. Choose ignore if there is a warning regarding the existence of MTC</p>
<p>8. After both installation is completed, verify the following components are installed.</p>
<p>        Oracle.DataAccess  2.112.1.0   (X86 and AMD64)<br />
        Policy.2.102.Oracle.DataAccess (X86 and AMD64)<br />
        Policy.2.111.Oracle.DataAccess  (X86 and AMD64)</p>
<p>9.  If the 64-bit version of Policy.2.102.Oracle.DataAccess or Policy.2.111.Oracle.DataAccess is missing in GAC, goto <Oracle home>\product\11.2.0\client_64\odp.net\PublisherPolicy\2.x\  folder and GAC it.  (make sure to run GACUTIL as Administrator to avoid policy permission issue)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.semaphoremd.com/2011/05/03/installing-32-bit-and-64-bit-oracle-11g-r2-odac-to-work-with-biztalk-2010-oracle-adapters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Restoring master secret when migrating BizTalk installation to a new server</title>
		<link>http://www.semaphoremd.com/2011/01/18/restoring-master-secret-when-migrating-biztalk-installation-to-a-new-server/</link>
		<comments>http://www.semaphoremd.com/2011/01/18/restoring-master-secret-when-migrating-biztalk-installation-to-a-new-server/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 19:22:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SSO]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[sso]]></category>

		<guid isPermaLink="false">http://letstalkbiztalk.wordpress.com/?p=67</guid>
		<description><![CDATA[There will be a time when BizTalk databases need to be migrated to a new SQL server i.e. hardware upgrade or configuring a new cluster. Before restoring the SSODB database, the original master secret need to be restored. In a SQL cluster environment, make sure to check off &#8220;Use Network Name for computer name&#8221; option [...]]]></description>
			<content:encoded><![CDATA[<p>There will be a time when BizTalk databases need to be migrated to a new SQL server i.e. hardware upgrade or configuring a new cluster.  Before restoring the SSODB database, the original master secret need to be restored.  In a SQL cluster environment, make sure to check off &#8220;Use Network Name for computer name&#8221; option on the general panel of the Enterprise SSO service cluster resource.  If this is not checked off, then you&#8217;ll most likely run into the following error when trying to choose the cluster name as the SSO server:</p>
<p>&#8220;Could not contact the SSO server XXX.  Check that SSO is configured and that the SSO service is running on that server.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.semaphoremd.com/2011/01/18/restoring-master-secret-when-migrating-biztalk-installation-to-a-new-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&quot;the binary code for the script is not found&quot; error</title>
		<link>http://www.semaphoremd.com/2010/06/16/the-binary-code-for-the-script-is-not-found-error/</link>
		<comments>http://www.semaphoremd.com/2010/06/16/the-binary-code-for-the-script-is-not-found-error/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 23:47:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[BAM]]></category>

		<guid isPermaLink="false">http://letstalkbiztalk.wordpress.com/?p=54</guid>
		<description><![CDATA[When working with BAM, if you try to run the BAM_AN_ SSIS package in SQL Server 2008 in order to load the activity data to the cube and get &#8220;the binary code for the script is not found&#8221; error, then it is most likely due to missing SQL Server component. Make sure to install the [...]]]></description>
			<content:encoded><![CDATA[<p>When working with BAM, if you try to run the BAM_AN_ SSIS package in SQL Server 2008 in order to load the activity data to the cube and get &#8220;the binary code for the script is not found&#8221; error, then it is most likely due to missing SQL Server component.  Make sure to install the Client Tool SDK and Client Tool Backward Compatibility from the SQL Server 2008 installation bits.  Then undeploy the existing BAM view and redeploy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.semaphoremd.com/2010/06/16/the-binary-code-for-the-script-is-not-found-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BizTalk project creation failed</title>
		<link>http://www.semaphoremd.com/2010/05/26/biztalk-project-creation-failed/</link>
		<comments>http://www.semaphoremd.com/2010/05/26/biztalk-project-creation-failed/#comments</comments>
		<pubDate>Wed, 26 May 2010 17:12:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://letstalkbiztalk.wordpress.com/?p=52</guid>
		<description><![CDATA[At some point all BizTalk developer will run into this pesky issue. You try to create a new BizTalk project and you get an &#8220;&#8230; project creation failed&#8221; error in Visual Studio. This is because, perhaps after a VS update or other installation, the &#8220;PossibleProjectExtensions&#8221; attribute in Windows registry get replaced by the default value. [...]]]></description>
			<content:encoded><![CDATA[<p>At some point all BizTalk developer will run into this pesky issue.  You try to create a new BizTalk project and you get an &#8220;&#8230; project creation failed&#8221; error in Visual Studio.  This is because, perhaps after a VS update or other installation, the &#8220;PossibleProjectExtensions&#8221; attribute in Windows registry get replaced by the default value.  BizTalk project extension, btproj, went missing.</p>
<p>To solve this issue, run regedit and goto the following:</p>
<p>For Win32 OS:<br />
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Projects\{FAE04EC0-301F-11d3-BF4B-00C04F79EFBC}]</p>
<p>For Win64 OS:<br />
KEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Projects\{FAE04EC0-301F-11d3-BF4B-00C04F79EFBC}</p>
<p>Add btprojc to PossibleProjectExtensions setting.  So it should look something like this:<br />
&#8220;PossibleProjectExtensions=&#8221;csproj;btproj&#8221;</p>
<p>Relaunch VS and you should be able to create BizTalk project now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.semaphoremd.com/2010/05/26/biztalk-project-creation-failed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FTP folder permission</title>
		<link>http://www.semaphoremd.com/2010/05/07/ftp-folder-permission/</link>
		<comments>http://www.semaphoremd.com/2010/05/07/ftp-folder-permission/#comments</comments>
		<pubDate>Fri, 07 May 2010 00:42:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ftp]]></category>

		<guid isPermaLink="false">http://letstalkbiztalk.wordpress.com/?p=49</guid>
		<description><![CDATA[The interface need to first check to see if a folder already exists on FTP server. If not it needs to create the folder first before the FTP adapter sends the message. After spending a day trying all sorts of methods, I finalized on the following approach: 1. create a helper class that establish a [...]]]></description>
			<content:encoded><![CDATA[<p>The interface need to first check to see if a folder already exists on FTP server.  If not it needs to create the folder first before the FTP adapter sends the message.  After spending a day trying all sorts of methods, I finalized on the following approach:</p>
<p>1. create a helper class that establish a TCP connection using System.Net.Sockets to the FTP server.<br />
2. After logging in, issue a MKDIR command.  Use Try..Catch block to trap for any error and evaluate if the return status code = 550, which indicates that the folder already exists.<br />
3. If a new folder is created, makes sure that the folder has the proper permission by issuing &#8220;SITE CHMOD  &#8221;<br />
4. upload the message via FTP adapter</p>
]]></content:encoded>
			<wfw:commentRss>http://www.semaphoremd.com/2010/05/07/ftp-folder-permission/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>update/delete operation DB2 table</title>
		<link>http://www.semaphoremd.com/2010/03/05/updatedelete-operation-db2-table/</link>
		<comments>http://www.semaphoremd.com/2010/03/05/updatedelete-operation-db2-table/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 19:04:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DB2]]></category>

		<guid isPermaLink="false">http://letstalkbiztalk.wordpress.com/?p=44</guid>
		<description><![CDATA[When selecting a recordset for update or delete from a DB2 table using the DB2 adapter, you may run into the following error when attempting to execute the update/delete statement: &#8221; &#60;DB2 table&#62; ?&#60;DB2 schema&#62; ?3 in *N not valid for operation.&#8221; This is because the table is not journaled and that DB2 adapter expects [...]]]></description>
			<content:encoded><![CDATA[<p>When selecting a recordset for update or delete from a DB2 table using the DB2 adapter, you may run into the following error when attempting to execute the update/delete statement:</p>
<p>&#8221; &lt;DB2 table&gt;   ?&lt;DB2 schema&gt; ?3 in *N not valid for operation.&#8221;</p>
<p>This is because the table is not journaled and that DB2 adapter expects to run in transactional mode.  To resolve this error, simply add &#8221; FOR UPDATE WITH NC&#8221; to the end of your select statement (NC = no commit).  Alternatively, enable journaling in the DB2 table.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.semaphoremd.com/2010/03/05/updatedelete-operation-db2-table/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Persisting AS2 message file name and file name-based message routing</title>
		<link>http://www.semaphoremd.com/2010/02/12/persisting-as2-message-file-name-and-file-name-based-message-routing/</link>
		<comments>http://www.semaphoremd.com/2010/02/12/persisting-as2-message-file-name-and-file-name-based-message-routing/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 22:58:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AS2]]></category>

		<guid isPermaLink="false">http://letstalkbiztalk.wordpress.com/?p=39</guid>
		<description><![CDATA[My client has a new requirement that calls for saving the inbound AS2-based message in it&#8217;s original file name, and that the file must be saved to a specified file folder if the inbound file name&#8217;s first 14 characters matches a string pattern. Reading this post http://blogs.msdn.com/biztalkb2b/archive/2009/08/05/as2-filename-preservation.aspx it implies that the AS2Receive pipeline component should [...]]]></description>
			<content:encoded><![CDATA[<p>My client has a new requirement that calls for saving the inbound AS2-based message in it&#8217;s original file name, and that the file must be saved to a specified file folder if the inbound file name&#8217;s first 14 characters matches a string pattern.</p>
<p>Reading this post http://blogs.msdn.com/biztalkb2b/archive/2009/08/05/as2-filename-preservation.aspx it implies that the AS2Receive pipeline component should take care of extrapolating the file name from AS2&#8242;s MIME header and writes it to EDIINT.PreservedFileName context property.  However this is not the case; this context property doesn&#8217;t exist during my testing.  Perhaps it is only written when using AS2EdiReceive pipeline component (my client is only using AS2 but not EDI)?</p>
<p>The filename does show up in AS2PayloadContentType context property.</p>
<p>Not able to verify if AS2EdiReceive component will promote the PreservedFileName property, I decided to create a custom pipeline component that parses the filename from  AS2PayloadContentType property value, promote the first 14 characters to a new context property via property schema, and write the parsed file name to ReceivedFileName so that %SourceFileName% macro can use it in the send port configuration.</p>
<p>Here&#8217;s the code for the Execute method in the custom pipeline component:</p>
<pre class="brush: csharp; title: ;">
public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(Microsoft.BizTalk.Component.Interop.IPipelineContext pc, Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
{
IBaseMessagePart bodyPart = inmsg.BodyPart;
IBaseMessageContext context = inmsg.Context;
string httpHeader = &amp;quot;&amp;quot;;
string filename = &amp;quot;&amp;quot;;
string prefix = &amp;quot;&amp;quot;;
if (bodyPart != null)
{
try
{   // determine which context property to read the filename string (user configurable in port configuration)
switch (_readContextProperty)
{
// strip out file path in the filename, parse the substring, and promote it as FileNamePrefix (in property schema) so that it can be used for msg routing
case &amp;quot;PreservedFileName&amp;quot;:
filename = Path.GetFileName(context.Read(&amp;quot;PreservedFileName&amp;quot;, &amp;quot;&amp;lt;a href=&amp;quot;http://schemas.microsoft.com/BizTalk/2006/as2-properties&amp;amp;quot;).ToString&amp;quot;&amp;gt;http://schemas.microsoft.com/BizTalk/2006/as2-properties&amp;quot;).ToString&amp;lt;/a&amp;gt;());
prefix = filename.Substring(_startPos, _length);
break;
case &amp;quot;AS2PayloadContentType&amp;quot;:
httpHeader = context.Read(&amp;quot;AS2PayloadContentType&amp;quot;, &amp;quot;&amp;lt;a href=&amp;quot;http://schemas.microsoft.com/BizTalk/2006/as2-properties&amp;amp;quot;).ToString&amp;quot;&amp;gt;http://schemas.microsoft.com/BizTalk/2006/as2-properties&amp;quot;).ToString&amp;lt;/a&amp;gt;();
filename = Path.GetFileName(httpHeader.Substring(httpHeader.IndexOf(&amp;quot;name=&amp;quot;) + 5));
prefix = filename.Substring(_startPos, _length);
break;
default:
filename = Path.GetFileName(context.Read(&amp;quot;ReceivedFileName&amp;quot;, &amp;quot;&amp;lt;a href=&amp;quot;http://schemas.microsoft.com/BizTalk/2003/file-properties&amp;amp;quot;).ToString&amp;quot;&amp;gt;http://schemas.microsoft.com/BizTalk/2003/file-properties&amp;quot;).ToString&amp;lt;/a&amp;gt;());
prefix = filename.Substring(_startPos, _length);
break;
}
context.Write(&amp;quot;ReceivedFileName&amp;quot;, &amp;quot;&amp;lt;a href=&amp;quot;http://schemas.microsoft.com/BizTalk/2003/file-properties&amp;quot;&amp;gt;http://schemas.microsoft.com/BizTalk/2003/file-properties&amp;lt;/a&amp;gt;&amp;quot;, filename);
context.Promote(&amp;quot;FileNamePrefix&amp;quot;, &amp;quot;&amp;lt;a href=&amp;quot;https://XXXXX.Pipelines.PipelinePropertySchema&amp;quot;&amp;gt;https://xxx.Pipelines.PipelinePropertySchema&amp;lt;/a&amp;gt;&amp;quot;, prefix);   // promote prefix for routing purpose
}
catch (Exception ex)
{
System.Diagnostics.EventLog.WriteEntry(&amp;quot;BizTalk - GetAS2FileNamePrefix Pipeline Component Error&amp;quot;, ex.ToString());
throw ex;
}
}
return inmsg;
}
</pre>
<p>I then created and deployed a property schema so that the pipeline component can promote the file name prefix string as a bona-fide context property.</p>
<pre class="brush: xml; title: ;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot; ?&gt;
 &lt;xs:schema xmlns:b=&quot;http://schemas.microsoft.com/BizTalk/2003&quot; xmlns=&quot;http://XXXXX.Pipelines.PipelinePropertySchema&quot; targetNamespace=&quot;https://XXXXX.Pipelines.PipelinePropertySchema&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;&lt;/div&gt;
&lt;xs:annotation&gt;
 &lt;xs:appinfo&gt;
&lt;b:schemaInfo schema_type=&quot;property&quot; xmlns:b=&quot;http://schemas.microsoft.com/BizTalk/2003&quot; /&gt;
&lt;/xs:appinfo&gt;
&lt;/xs:annotation&gt;
 &lt;xs:element name=&quot;FileNamePrefix&quot; type=&quot;xs:string&quot;&gt;
&lt;xs:annotation&gt;
 &lt;xs:appinfo&gt;
&lt;b:fieldInfo propertyGuid=&quot;92ce386d-71bb-4d7a-8f2e-e76a0e229120&quot; rootTypeName=&quot;FileNamePrefix&quot; /&gt;
&lt;/xs:appinfo&gt;
&lt;/xs:annotation&gt;
&lt;/xs:element&gt;
&lt;/xs:schema&gt;
</pre>
<p>In the receive location I configured the new receive pipeline with the following:<br />
Finally a new send port is created with the following filter criteria:</p>
<p>Filter: XXXXX.Pipelines.FileNamePrefix == &lt;file name prefix&gt; And<br />
EdiIntAS.IsAS2MdnResponseMessage == False And<br />
EdiIntAS.AS2From == XYZ</p>
<p>Then I created a new receive pipeline artifact and added the following components</p>
<p>Decode Stage: AS2Decode<br />
Disassemble Stage: AS2Disassemble<br />
Validate Stage: &lt;new custom pipeline component&gt;</p>
<p>Once the pipeline is deployed, set the following value in the pipeline&#8217;s runtime properties:</p>
<p>Length: 14<br />
readContextProperty: AS2PayloadContentType<br />
startPos: 0</p>
]]></content:encoded>
			<wfw:commentRss>http://www.semaphoremd.com/2010/02/12/persisting-as2-message-file-name-and-file-name-based-message-routing/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
