BizTalk Server Applications Integration - Biztalk 2000 with C# AIC?

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Applications Integration > December 2004 > Biztalk 2000 with C# AIC?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Biztalk 2000 with C# AIC?
Jan

2004-12-09, 8:48 pm

Is it possible to use a C# AIC with Biztalk 2000? We can register our C# AIC
on our Biztalk server with component services, but when we go to add a port
using Biztalk messaging manager, the component name is not available even
though the transport type is set to Application Integration Component and the
registry entries appear to be correct. Any ideas?

thx,
Jan
Deepak Lakshmanan

2004-12-14, 9:27 pm

Long back when I was working with Biztalk 2000 I had similar problems. I got
this reply from somebody in a newsgroup which was very helpful

Hope this helps
Deepak
---------------------------------------------------------------------------------------------
For what it's worth, here are the steps that I have found to work
1) Create a new class library project.
2) Add References. You need the System.EnterpriseServices, and
BTSComponentsLib references. BTSComponentsLib is added to the GAC after
you install the .NET toolkit for BTS2002 by running setup_toolkit.cmd
from the install folder. These references are necessary to support the
integration with BizTalk as well as to add the component to COM+
3) Add using/imports statements. These will save typing later. (C#
example follows).
using Microsoft.BizTalk.BTSComponentsLib;
using System.EnterpriseServices;
using System.Runtime.InteropServices;
4) Apply a Guid attribute to your class. The Guid is used to identify
your class [or perhaps the default interface?] in the registry. You can
create a Guid in the IDE using Tools->Create GUID. Copy and paste the
GUID into the attribute. A sample attribute follows (please use your
own Guid instead of copying this line exactly).
5) Inherit from ServicedComponent. Implement the IBTSAppIntegration
interface. Again this allows us to add the component to COM+ and to
integrate with BizTalk.

[Guid("E422274A-07A4-442e-BA1C-310AA1DB9271")]
public class Import : ServicedComponent, IBTSAppIntegration

6) In order to satisfy the interface requirements for
IBTSAppIntegration, you need a function to implement the ProcessMessage
function.

public string ProcessMessage(string strDocument)
{
//* Do fantastic wonderful appIntegration stuff here.

return strDocument; //* Not quite sure who gets to see this
}

7) You should be able to compile the dll at this point, but it won't do
any good. BizTalk is blind to it's existence. At a command prompt,
navigate to the project directory and execute the following command
(if you can't find the command, use the visual studio command prompt
found in the Visual Studio start menu folder):

sn -k keypair.snk

8) That file's pretty important. Add it to your project using Add->Add
Existing Item. To use the key file to create a strong name for your
file, edit the AssemblyInfo.cs (or .vb) file and update the
AssemblyKeyFile attribute. The @ is C# syntax so we don't have to
escape the \ characters. The relative path allows the debug or release
versions to point to the file in the project directory.

[assembly: AssemblyKeyFile(@"..\..\keypair.snk")]

9) Add a using/imports statement to AssemblyInfo.cs. This allows us to
add a few more attributes to the file. The application name and
description are pretty arbitrary and the ApplicationID is just another
GUID created from the IDE. Even though I registered my component for
COM Interop and added it to COM+ (see below) I couldn't get BizTalk to
see my component until I added this.

using System.EnterpriseServices;

[assembly: ApplicationName("AcmeProductsAIC.Import")]
[assembly: ApplicationID("62A5344A-F3DF-4175-BD6C-037AC42EA454")]
[assembly: Description("IBTSAppIntegration AIC Using C#.NET ")]

10) To support COM, right-click on the project and select properties.
Change the configuration dropdown to "All Configurations" and change the
"Register for COM Interop" to True.

11) While you're mucking about in the project projecties, you might as
well get debugging set up. Change the configuration dropdown back to
debug and under Configuration Properties->Debugging, set the Debug Mode
to Program. Change the Start Application to "C:\Program Files\Microsoft
BizTalk Server\MSCIS.exe" (assuming that's where it's installed).

12) Build your component. You should see that it's being registered for
COM Interop. Whoopeee! When that's finished, you can add the DLL to
COM+ by typing (please use the right dll name and path - don't use debug
if you've built a release version):

regsvcs debug\bin\yourdllname.dll


In theory (remember, in theory communism works), you should have a dll
registered in COM+ that can be called as an AIC.

Random stuff that I've found:
------------------------------
- Stop BizTalk Messaging Service when debugging to ensure your component
gets the call.

- I haven't figured it out, but occasionally IIS holds a reference to my
DLL and I can't rebuild after making changes. I use iisreset at the
command prompt to bounce the service and free the reference.

----------------------------------------------------------------------------------------------

"Jan" wrote:

> Is it possible to use a C# AIC with Biztalk 2000? We can register our C# AIC
> on our Biztalk server with component services, but when we go to add a port
> using Biztalk messaging manager, the component name is not available even
> though the transport type is set to Application Integration Component and the
> registry entries appear to be correct. Any ideas?
>
> thx,
> Jan

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com