The Advanced sample demonstrates how to use the Deployment Framework for BizTalk with multiple orchestrations, C# helper classes, runtime access to SSO settings, virtual directory deployment, the BizTalk HTTP ISAPI filter, log4net logging, pre-processing an XML file and NUnit deployment tests.
What this Sample Does
This application contains two separate functions: one that receives a message through the HTTP ISAPI filter and returns the same message in the response, and a second that takes in a file and writes out another file while processing it through orchestrations and maps.
How this Sample is Designed and Why
The first function of this sample is a message echo via the HTTP adapter (an IIS ISAPI filter). An NUnit test posts an XML message to the HTTP adapter and an orchestration named Echo.odx receives it and sends back the same message. The NUnit test validates that the message was echoed back. This part of the sample demonstrates deployment of an IIS virtual directory (the VDir_Advanced folder in the sample directory) and an IIS ISAPI filter. In the deployment project (.btdfproj) file, the properties IncludeVirtualDirectories, WseExtensionPath and WseExtensionName and the ItemGroup VDirList are all related to these functions. The two Wse* properties are only used to deploy the BizTalk HTTP adapter ISAPI filter, so they are not required when deploying a virtual directory with a .NET web service.
The sample uses the Deployment Framework for BizTalk's environment-specific configuration features to dynamically transform a template bindings XML file into an environment-specific bindings file (see BasicMasterBindings sample). The Excel settings spreadsheet, SettingsFileGenerator.xml, also contains a number of settings used to demonstrate reading values from SSO at runtime.
The second function of this sample is to read in a file, then pass it through an orchestration while writing to Log4Net, calling out to a C# helper component to construct a message and dynamically reading settings from SSO, and finally writing a file to an output folder. An NUnit test copies the input file TestFiles\S1_output.xml to the InDir folder within the sample solution folder (which you are free to do manually). The file is handled by the orchestration TopLevelOrch.odx, which configures and writes to a Log4Net logger and reads some settings from the SSO database (which originated in the Excel settings spreadsheet SettingsFileGenerator.xml). The orchestration calls CalledOrch.odx to transform the message, and the final message is written out to a file at C:\DeploymentFrameworkForBizTalk\Samples\Advanced\OutDir. The NUnit test waits for the output file to appear and fails if it does not.
One extensibility feature demonstrated in the sample's Deployment.btdfproj project file is how to package additional files into the MSI so that they are deployed to the server along with the application binaries and other project files. The CustomRedist target is called during MSI packaging, and in the sample it copies the files in the TestFiles folder into the MSI staging folder (defined by the $(RedistDir) MSBuild property).
Where to Find this Sample
<BTDFInstallFolder>\Samples\BizTalk2006\Advanced or <BTDFInstallFolder>\Samples\BizTalk2009\Advanced
NOTE: The BizTalk 2006/2006 R2 version of the sample must be prepared by running PrepareSample.bat in the Samples\BizTalk2006\Advanced folder.
NOTE: After upgrading the solution to BizTalk 2010 or newer, you must upgrade the .NET class library project to target .NET Framework 4.0.
Building and Deploying this Sample
NOTE: If you are running on x64 Windows with 64-bit hosts, see the Log4Net registry key note here. The orchestrations will fail unless the 64-bit registry key is created.
Running this Sample
Removing this Sample
Created with the Personal Edition of HelpNDoc: Full-featured multi-format Help generator