Use ESB Exception Handling Only

Most of the time, you only want to use the exception handling functionality of the ESB Toolkit. In that case you can include the necessary artefacts in a BizTalk.Framework application. You will still have to create the ESB Exception database via the ESB Configuration Tool first. Next, in case you use the BizTalk Deployment Framework you can change your btdfproj deployment project as follows:

<ItemGroup>
<Schemas Include=”Microsoft.Practices.ESB.ExceptionHandling.Schemas.Faults.dll”>
<LocationPath>..\References</LocationPath>
</Schemas>
<Schemas Include=”Microsoft.Practices.ESB.ExceptionHandling.Schemas.Reporting.dll”>
<LocationPath>..\References</LocationPath>
</Schemas>
</ItemGroup>

<ItemGroup>
<Pipelines Include=”Microsoft.Practices.ESB.ExceptionHandling.Pipelines.dll”>
<LocationPath>..\References</LocationPath>
</Pipelines>
</ItemGroup>

<ItemGroup>
<ExternalAssemblies Include=”EntityFramework.dll”>
<LocationPath>..\packages\EntityFramework.6.1.3\lib\net45</LocationPath>
</ExternalAssemblies>
<ExternalAssemblies Include=”EntityFramework.SqlServer.dll”>
<LocationPath>..\packages\EntityFramework.6.1.3\lib\net45</LocationPath>
</ExternalAssemblies>
<ExternalAssemblies Include=”Microsoft.BizTalk.CAT.BestPractices.Framework.dll”>
<LocationPath>..\References</LocationPath>
</ExternalAssemblies>
<ExternalAssemblies Include=”Winterdom.BizTalk.PipelineTesting.dll”>
<LocationPath>..\References</LocationPath>
</ExternalAssemblies>
<ExternalAssemblies Include=”xmlunit.dll”>
<LocationPath>..\References</LocationPath>
</ExternalAssemblies>
<ExternalAssemblies Include=”Microsoft.Practices.ESB.ExceptionHandling.dll”>
<LocationPath>..\References</LocationPath>
</ExternalAssemblies>
</ItemGroup>

Because you use a relative path to the References folder, you manually have to add this folder and the specific assemblies to the root of your project. As an example, because you specify a Pipelines node with a reference to the ESB Toolkit Pipelines assembly, a pipeline named ESBFaultProcessor will be added in the Pipelines folder of the BizTalk.Framework application in the BizTalk Admin Console. Also note that references to the EntityFramework and CAT Framework folder are added here.

Next you can create an application BizTalk.ExceptionHandling with a send port that adds exceptions to the Exception database. That’s it!

<SendPort Name=”ErrorHandling.SP.Exceptions.WCF-SQL” IsStatic=”true” IsTwoWay=”false” BindingOption=”0″>
<Description xsi:nil=”true” />
<TransmitPipeline Name=”Microsoft.Practices.ESB.ExceptionHandling.Pipelines.ESBFaultProcessor” FullyQualifiedName=”Microsoft.Practices.ESB.ExceptionHandling.Pipelines.ESBFaultProcessor, Microsoft.Practices.ESB.ExceptionHandling.Pipelines, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ Type=”2″ TrackingOption=”ServiceStartEnd MessageSendReceive InboundMessageBody OutboundMessageBody PipelineEvents” Description=”” />
<SendPipelineData>&lt;Root xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”&gt;&lt;Stages&gt;&lt;Stage CategoryId=”9d0e4108-4cce-4536-83fa-4a5040674ad6″&gt;&lt;Components&gt;&lt;Component Name=”Microsoft.Practices.ESB.ExceptionHandling.PipelineComponents.ProcessFault”&gt;&lt;Properties /&gt;&lt;/Component&gt;&lt;Component Name=”Microsoft.Practices.ESB.ExceptionHandling.PipelineComponents.BamApiProcessFault”&gt;&lt;Properties&gt;&lt;Enabled vt=”11″&gt;0&lt;/Enabled&gt;&lt;/Properties&gt;&lt;/Component&gt;&lt;Component Name=”Microsoft.Practices.ESB.ExceptionHandling.PipelineComponents.TransformPipelineComponent”&gt;&lt;Properties&gt;&lt;MapName vt=”8″&gt;Kw1c.BizTalk.ErrorHandling.Maps.EsbFaultMessage_To_EsbCompositeInsertFault, Kw1c.BizTalk.ErrorHandling.Maps, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e42f6bb5f05acbd0&lt;/MapName&gt;&lt;/Properties&gt;&lt;/Component&gt;&lt;/Components&gt;&lt;/Stage&gt;&lt;/Stages&gt;&lt;/Root&gt;</SendPipelineData>
<PrimaryTransport>
<Address>mssql://${ErrorHandling.SP.Exceptions.WCF-SQL.SQLServer}//EsbExceptionDb?</Address>
<TransportType Name=”WCF-SQL” Capabilities=”779″ ConfigurationClsid=”59b35d03-6a06-4734-a249-ef561254ecf7″ />
<TransportTypeData>&lt;CustomProps&gt;&lt;BindingType vt=”8″&gt;sqlBinding&lt;/BindingType&gt;&lt;BindingConfiguration vt=”8″&gt;&amp;lt;binding name=”sqlBinding” /&amp;gt;&lt;/BindingConfiguration&gt;&lt;InboundBodyPathExpression vt=”8″ /&gt;&lt;OutboundBodyLocation vt=”8″&gt;UseBodyElement&lt;/OutboundBodyLocation&gt;&lt;AffiliateApplicationName vt=”8″ /&gt;&lt;StaticAction vt=”8″&gt;CompositeOperation&lt;/StaticAction&gt;&lt;ProxyUserName vt=”8″ /&gt;&lt;ProxyAddress vt=”8″ /&gt;&lt;UserName vt=”8″ /&gt;&lt;InboundBodyLocation vt=”8″&gt;UseBodyElement&lt;/InboundBodyLocation&gt;&lt;EndpointBehaviorConfiguration vt=”8″&gt;&amp;lt;behavior name=”EndpointBehavior” /&amp;gt;&lt;/EndpointBehaviorConfiguration&gt;&lt;OutboundXmlTemplate vt=”8″&gt;&amp;lt;bts-msg-body xmlns=”http://www.microsoft.com/schemas/bts2007″ encoding=”xml” /&amp;gt;&lt;/OutboundXmlTemplate&gt;&lt;PropagateFaultMessage vt=”11″&gt;-1&lt;/PropagateFaultMessage&gt;&lt;InboundNodeEncoding vt=”8″&gt;Xml&lt;/InboundNodeEncoding&gt;&lt;IsolationLevel vt=”8″&gt;ReadCommitted&lt;/IsolationLevel&gt;&lt;UseSSO vt=”11″&gt;0&lt;/UseSSO&gt;&lt;EnableTransaction vt=”11″&gt;-1&lt;/EnableTransaction&gt;&lt;/CustomProps&gt;</TransportTypeData>
<RetryCount>${ErrorHandling.SP.Exceptions.WCF-SQL.RetryCount}</RetryCount>
<RetryInterval>5</RetryInterval>
<ServiceWindowEnabled>false</ServiceWindowEnabled>
<FromTime>2000-01-01T23:00:00</FromTime>
<ToTime>2000-01-01T22:59:59</ToTime>
<Primary>true</Primary>
<OrderedDelivery>false</OrderedDelivery>
<DeliveryNotification>1</DeliveryNotification>
<SendHandler Name=”BizTalkServerSendHost” HostTrusted=”false”>
<TransportType Name=”WCF-SQL” Capabilities=”779″ ConfigurationClsid=”59b35d03-6a06-4734-a249-ef561254ecf7″ />
</SendHandler>
</PrimaryTransport>
<SecondaryTransport>
<Address />
<RetryCount>3</RetryCount>
<RetryInterval>5</RetryInterval>
<ServiceWindowEnabled>false</ServiceWindowEnabled>
<FromTime>2000-01-01T23:00:00</FromTime>
<ToTime>2000-01-01T22:59:59</ToTime>
<Primary>false</Primary>
<OrderedDelivery>false</OrderedDelivery>
<DeliveryNotification>1</DeliveryNotification>
<SendHandler xsi:nil=”true” />
</SecondaryTransport>
<ReceivePipelineData xsi:nil=”true” />
<Tracking>${ErrorHandling.SP.Exceptions.WCF-SQL.Tracking}</Tracking>
<Filter>&lt;Filter&gt;
&lt;Group&gt;
&lt;Statement Property=”BTS.MessageType” Operator=”0″ Value=”http://schemas.microsoft.biztalk.practices.esb.com/exceptionhandling#FaultEnvelope” /&gt;
&lt;/Group&gt;
&lt;/Filter&gt;</Filter>
<Transforms />
<OrderedDelivery>false</OrderedDelivery>
<Priority>5</Priority>
<StopSendingOnFailure>false</StopSendingOnFailure>
<RouteFailedMessage>false</RouteFailedMessage>
<ApplicationName>Kw1c.BizTalk.ErrorHandling</ApplicationName>
</SendPort>

Leave a Reply

Your email address will not be published. Required fields are marked *