Tallan's Technology Blog

Tallan's Top Technologists Share Their Thoughts on Today's Technology Challenges

How to Create a Simple SWIFT Application in BizTalk

Chetan Vangala

SWIFT – or the Society for Worldwide Interbank Financial Telecommunication – is the main global provider for secure messaging in financial transactions. The standard they created and currently maintain is utilized by hundreds of banks throughout the world. Today we’re going to go through a quick tutorial for getting set up with A4SWIFT, BizTalk’s SWIFT messaging accelerator for speeding up integration with this platform.

Setting Up A4SWIFT

Setting up the SWIFT accelerator is actually very easy. The installation files are located in the same package as the BizTalk installation. In this guide, we’re going to use BizTalk 2013 R2, for which the root folder of the installation media looks like this:

1

Navigating into the BizTalk Accelerators from here brings us to a folder with a number of different accelerators, but we can get to the installation wizards by just starting the Setup application below.

2

The Setup screen gives us access to installation wizards for every accelerator in this directory. We’ll go ahead and click “Install Microsoft BizTalk 2013 R2 Accelerator for SWIFT” here, to move on to that installation process.

3

 

For most purposes, the default installation will be fine here. However, the accelerator’s runtime components may not be installed correctly if certain pre-requisites aren’t met. Most of these will already have been met by any current BizTalk user, but there are some that may not, so make sure to have the following set up before proceeding past this point:

  • Of course, the BizTalk installation on the same disk image must be completed
  • SQL Server must be up and running
  • the user running the installation package must be a member of the “BizTalk Server Administrators” group

Leveraging A4SWIFT in a Simple Messaging Application

Now that we have the SWIFT accelerator installed, we can move along to creating a simple application to test out some of the features that are now available to us.

Adding in A4SWIFT Schemas

As one would with most BizTalk projects, we’ll start by adding some schemas. The SWIFT accelerator provides us with a plenty of schemas that we can leverage in order to speed up and help standardize our SWIFT development tasks.

The schemas provided by the accelerator can be found in this folder:

{INSTALLATION DRIVE}:\{PROGRAM FILES DIRECTORY}\Microsoft BizTalk Accelerator for SWIFT {VERSION} MessagePack\SWIFT Messages\A4SWIFT-SRG{VERSION}\

With the 2013 accelerator, that brings us to:4

 

As you can see below, there are a number of different categories of schemas for us to choose from.

5

We’ll go into these in a moment, but first we’ll navigate into the Base Schemas folder. This contains some of the base types that are used by the more specific schemas that we’ll be adding later, so we’ll go ahead and add both of these files into our schema project.

Going back to Visual Studio for a minute to do this, we’ll right-click on the schemas project, go to the “Add” menu, and select “Existing Item…”. Then we’ll navigate back to the Base Schemas folder, select both “SWIFT Base Types” and “SWIFT Common Data Types”, and click “Add” to add them into the project.

6

 

7

Once we’ve done that we’ll navigate back into the previous folder and follow the same process to add a category-specific schema.

For those of you who are new to SWIFT messaging, these categories correspond to a number of different transaction types within the SWIFT standard. Some of the categories are for transactions within treasury markets or security markets, but for the purpose of simplicity, we’ll stick with Category 1 for this application, which is used for Customer Payments and Cheques.

8

Even within this folder there are a many different message types. A quick peek at the SWIFT User Handbook shows us some of the different uses for these message types.

9

For further information, you can go to https://www2.swift.com/uhbonline/books/a2z/standards_mt.htm and check out the latest standards for yourselves, but for our purposes we’ll be working with MT103, the message type for Single Customer Credit Transfers.

10

Business rules and envelope schemas are outside the scope of this sample app, but the SWIFT accelerator provides us with infrastructure for them as well, as you can see in the image above. For now, though, we’ll go ahead and just grab the “MT103” schema file and add it to the schemas project so we have a schema for our sample application to work with.

11

Utilizing Custom Pipeline Components

The SWIFT accelerator also provides us some pipeline components which we can use in our application. They should be added to the toolbox automatically, but in case they aren’t, we can navigate to Tools -> Choose Toolbox Items in Visual Studio and add them in:

12

Now these should all be available in the appropriate toolboxes. In order to use these, we’re going to add a pipeline project in our solution:

pipelineproject

Inside it, we’ll add a receive pipeline and a send pipeline for us to work with, as well as a reference to the SwiftTester.Schemas project from earlier.

If we open the receive pipeline, we’ll see that the toolbox includes the SWIFT Disassembler component, which we can go ahead and add into our pipeline. Adding this in gives us a lot of extra functionality:

  • Dynamically discovers the message type and resolves the document schema
  • Parses SWIFT flat files into XML
  • Invokes the XML validating reader to perform XML (schema) validation
  • Invokes the Business Rules Engine (BRE) to perform BRE validation
  • Publishes a parsed XML message to the MessageBox database with promoted context properties and serialized error collection XML
  • Processes and disassembles inbound batches

The MSDN documentation lists the above features. For more information on the disassembler itself, check out this article. Some of these features can be modified or enabled/disabled by settings in the properties window. Some of them are SWIFT specific, such as the SWIFT Header Schema, and the SWIFTBound property promotion toggle. We will actually disable BRE Validation, since this sample application won’t be using that feature.

14

15

There are also a few other components that could be useful outside the scope of our application, including a couple decoders and an additional disassembler for the MX standard as opposed to the MT standard that we are working with in this application.

The MX standard is a newer standard which uses xml-style messages and is intended to be more flexible than the older MT standard. This disassembler could easily be switched out for the MX version, depending on what types of messages the system is going to be receiving.

Now that we’ve updated the receive pipeline, we’ll do the same for the send pipeline as well, following the same process with the SWIFT Assembler component this time. The assembler has less functionality than the Disassembler, by its nature. Its main functions are to resolve the outbound schema using the discovered message type and serialize the message into the SWIFT flat file format. More information on this component can be found here.

16

Once this is complete, we can go ahead and build, deploy, and start using these pipelines in our application.

 

Other Artifacts

The SWIFT accelerator also provides a number of other useful assemblies, which can be found in the following folder:

{INSTALLATION DRIVE}:\{PROGRAM FILES DIRECTORY}\Microsoft BizTalk Accelerator for SWIFT\Assemblies

17

These assemblies contain additional validation and other functionality which can be very helpful when handling SWIFT messages.

Putting It All in Context

Now that we have some schemas and pipelines in place, we can create a simple application to test out some of the SWIFT accelerator’s functionality.

Now we’ll build the solution, and create a SwiftTester application in the BizTalk Admin Console. This will allow us to deploy the schema and pipeline projects to the new application. When this step is completed, the new application should have access to the recently created artifacts, as seen below:

18

We’re going to use these artifacts to create a simple publish/subscribe architecture. To start that off, we’ll go ahead and add a receive port and a receive location for MT files.

mt_rcvport

mt_rcvlocation

Note that we’re using the receive pipeline we created earlier, so we can take advantage of the SWIFT disassembler. If we were inclined to do so, we could create a map as well to map to some internal format, using our MT103 schema.

Since the purpose here is just to test out some of the artifacts we created, we’ll also create a send port that picks up the file from the receive port and sends it through to a destination folder. This will give us a chance to test out the pipelines on any valid MT103 file.

mt_sendport

 

mt_sendfilters

Now all we have to do is start up these ports, and we should be able to send a sample message all the way through. Hopefully, this guide has provided a helpful base for creating a BizTalk application that can handle SWIFT messages. It should be fairly easy to add new artifacts from here to enhance the application and provide some solid integration with SWIFT-centric platforms.

 

Tags: Integration, swift,

No comments

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

\\\