Developing an Application Integration Component (AIC) in BizTalk Server to Parse XML Data and Store


This article explains the various steps that are needed to develop an application integration component (AIC) in BizTalk Server to parse XML data and store into SQL Server table.

Creating an XML Data File

Create an XML data file using any text editor, such as Notepad, enter the following segment, and save it as Books.xml.

   <Book BookID="ABC"
         BookName="Designing Databases with SQL Server"
         Author="John Murray" Price="250">
   <Book BookID="XYZ"
         BookName="EAI Implementation with BizTalk Server"
         Author="Jim Carry" Price="500">

Creating a Table in SQL Server to Store XML Data

Run the following commands by using the SQL Server query analyser tool to create the necessary database, tables, and stored procedures in SQL Server.

USE master
                            FILENAME = 'c:\program files _
                                          \microsoft sql server _

CREATE TABLE Books (sID char(8) NOT NULL, sName varchar(250) _
                    NOT NULL, sAuthor varchar(50) NOT NULL, _
                    iPrice int NOT NULL)

CREATE PROCEDURE StoreBooks @doc text as
DECLARE @idoc int
EXEC sp_xml_preparedocument @idoc OUTPUT, @doc
INSERT INTO Books(sID, sName, sAuthor, iPrice)
SELECT * FROM OPENXML (@idoc, '/Books/Book', 0) _
         WITH (BookID char(8), BookName varchar(250), _
               Author varchar(50), Price int)
EXEC sp_xml_removedocument @idoc


Creating a VB ActiveX DLL Component

Create a new ActiveX DLL project using Visual Basic. From Project menu, select the References item and add the following references to the project.

  • Microsoft BizTalk Server Application Interface Components 1.0 Type Library
  • Microsoft ActiveX Data Objects 2.5 Library
  • Microsoft XML, v3.0

Enter the following code in the code window for the class:

Implements IBTSAppIntegration
Public Function IBTSAppIntegration_ProcessMessage(ByVal _
                bstrDocument As String)
As String
Dim con
Dim cmd
Dim dom

Const adCmdStoredProc = 4
Const adChar          = 129
Const adParamInput    = 1

Set dom   = CreateObject("MSXML2.DOMDocument")
dom.async = False
dom.LoadXML bstrDocument

Set con = CreateObject("adodb.connection")
con.Open "Provider=sqloledb; Data Source=(local);Initial _
          Catalog=master;", "sa", ""

Set cmd = CreateObject("adodb.command")
cmd.ActiveConnection = con
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "StoreBooks"
cmd.Parameters.Append cmd.CreateParameter("@doc", adChar, _
               adParamInput, Len(dom.xml), dom.xml)

Set cmd = Nothing
Set con = Nothing
Set dom = Nothing
IBTSAppIntegration_ProcessMessage = True
End Function

First, name the class StoreBooks. Then, save the project as StoreBooks.vbp, build StoreBooks.dll, and register the DLL by using regsvr32 from the command prompt.

Deploying an ActiveX DLL Component in COM+

  1. Launch the Component Services from Control Panel or Administrative Tools.
  2. Expand the Component Services until you get COM+ Applications.
  3. Right-click COM+ Applications, click New, click Application, and click Next.
  4. Click Create an empty application.
  5. Enter a name for the application, and then click Next.
  6. Click the This user radio button and type in the username and password for the account that you want this application to run under. Click Finish.
  7. Navigate through the list of COM+ applications and expand your newly created application.
  8. Right-click the Components folder for this application, click New, click Component, and then click Next.
  9. Click Install new component(s), browse to StoreBooks.dll that you have created already, select the DLL, click Open, click Next, and then click Finish.

Marking the Component as AIC in BizTalk Server

To use a COM component as an AIC in BizTalk Server, the component must be registered with the category IDs for all components and for the specific type of component; in this case, that would be application integration. You need to register the AIC component as out-of-process to provide better isolation level.

Sometimes, an AIC component also can be registered as in-process to increase its performance. In the case of out-of-process, the component must be configured to run in an identity other than the interactive user. The AIC component must be registered by a user that belongs to the BizTalk Server Administrators group.

Each AIC component must be associated with two category IDs. One category ID specifies the component as a BizTalk Server component. The other category ID indicates the type of the component. In this case, the type is application integration components (AIC).

To assign category IDs for VB component, you need to first register your component using Regsvr32. Then, search the Registry for the CLSID of your AIC under the HKEY_CLASSES_ROOT\CLSID key. Next, expand the Implemented Categories key of your AIC. You need to add two new keys as follows:


The first key shown above identifies the AIC as a BizTalk Server component. The second key identifies the component as an AIC component.

Configuration of AIC Component in BizTalk Server

You now have an Application Integration Component (AIC) to parse XML data and store it into a SQL Server table. If you expand the Components folder, you can see the interfaces for your component.

To test this AIC component, you need to create a file receive function using BizTalk Server Administration tool to receive the Books.xml file, and then hand it over to a channel that is associated with a port that has a primary transport of Application Integration Component (AIC).

Then, you browse to the component and choose the component name for a transport type of Application Integration Component (AIC) at the time you configure the destination port in the Messaging Manager.


This article clearly explained the steps needed to develop an application integration component (AIC) in BizTalk Server to parse XML data and store it into a SQL Server table.

Syed Hameed
Wipro Technologies
Bangalore, India

About the Author

Syed Hameed

The author is working for Accenture. He has more than 6 years of experience in Microsoft solution design and development. Some of his major clients are IBM, Caterpillar Inc, Ford Motor Company, Borg warner Automatives, Litton Loan Servicing, Barwil Shipping Corporation, Marks and Spencer.


  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Complex hybrid environments can make it difficult to track interdependencies, increasing the risk of disrupting critical business services. In this white paper by EMA, you'll learn how application discovery and dependency mapping can help you: Meet granular targets for availability, cost, and time-to-revenue for cloud services. Accelerate mean time to repair (MTTR) while communicating better with stakeholders. Manage even the most complex hybrid environments more efficiently and effectively Understand the …

  • Rocket Mobile® for IBM i is an enterprise mobile application development and deployment platform for customers who rely on the IBM i system. Rocket Mobile for IBM i enables customers to leave proven applications in-place and rapidly repurpose them into new managed and secure mobile applications. Fast, easy creation of mobile, web, and hybrid mobile applications that deploy to any iOS, Android, or Windows mobile phone or tablet Built-in integration for seamless repurposing of existing IBM i applications …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date