Advanced

Parent Previous Next

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

  1. Open the solution file Advanced.sln in Visual Studio.  If necessary, upgrade the solution and projects to Visual Studio 2010 format.
  2. Build the solution and ensure that the build succeeded
  3. On a 32-bit system, copy BTSHTTPReceive.dll from <BizTalkInstallFolder>\HttpReceive to the Advanced sample's VDir_Advanced folder and overwrite the existing file.  On a 64-bit system, copy from HttpReceive64.
  4. Deploy the application using the Deployment Framework's Visual Studio Deploy command
  5. On a 64-bit system, in IIS Manager, configure the BTDFAdvancedSample application pool to run in 64-bit mode (Enable 32-bit Applications = False).
  6. In IIS Manager, configure the BTDFAdvancedSample application pool identity to run as your BizTalk service account (same as your host instances).
  7. On a 64-bit system, add a 64-bit copy of the log4net registry entry (see NOTE below).
  8. The Deployment Framework will create an output folder at C:\DeploymentFrameworkForBizTalk\Samples\Advanced\OutDir
  9. Confirm that the deployment process succeeded and the application is now running in BizTalk (see the Visual Studio Output window and BizTalk Admin Console)
  10. If desired, package the application into an MSI using the Build Server MSI command


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

  1. Run the deployment tests by starting NUnit from <BTDFInstallFolder>\Framework\DeployTools\NUnitSubset\nunit-gui.exe, then load the test assembly <ProjectFolder>\DeploymentTest\bin\Debug\DeploymentFramework.Samples.Advanced.DeploymentTest.dll.
  2. Verify that the NUnit tests ran successfully.


Removing this Sample

  1. With the Advanced.sln open in Visual Studio, use the Deployment Framework's Visual Studio Undeploy command
  2. Delete the folder C:\DeploymentFrameworkForBizTalk\Samples\Advanced
  3. Delete the IIS application pool BTDFAdvancedSample.


Created with the Personal Edition of HelpNDoc: Full-featured multi-format Help generator