Adapter Hosting
In BizTalk Server, adapters are divided into two classes based on how they are hosted. These are "Regular" (in-process) and "Isolated" (out-of-process).
Regular
Regular adapters are also referred to as "in-process." A regular adapter is created and hosted within the BizTalk service process, Btsntsvc.exe. This means that BizTalk creates and manages the lifetime of the adapter, initializes it with a transport proxy, services the adapter requests, and terminates the adapter upon service shutdown.
In regular adapters, BizTalk also delivers any configuration to the adapter at run time, including handler, send port, and receive location configuration. In addition, aspects of configuration such as service windows are handled by the Messaging Engine so that the adapter does not need to ensure that a receive location or send port is outside of a service window.
Note that all send adapters are regular adapters.
Isolated
Isolated, or "out-of-process", adapters make up a small subset of adapters. These adapters are created in an isolated host that is not part of the BizTalk runtime. There are scenarios when hosting receive adapters in the BizTalk process is not possible. For example, the Internet Information Services (IIS) process model is such that IIS manages the lifetime of ASP.NET applications and ISAPI extensions. When it is not possible for BizTalk to manage the lifetime of the adapter, the adapter is referred to as an isolated adapter.
The AS2 receive adapter is one such adapter. Because the adapter takes care of fetching its own configuration from the BizTalk server and uses that configuration to process messages, all you need to do is create an instance of the adapter within the isolated host. In the case of the AS2 receive adapter, all you need to do is instantiate it within a webpage. You can find an example of this in the included ASP.NET demo project.
Note that when reinstalling adapters, IIS AND BizTalk must be stopped/restarted in order to force the handles to be released so that the re-install will function as expected.
Permissions
For any adapter to be able to fetch its configuration from the SQL databases used by BizTalk Server, the application under which the adapter runs must have proper security access to the SQL server. Normally, BizTalk Server takes care of this when you create a new host and set the user identities for the various groups like "BizTalk Isolated Host Users". BizTalk Server will make sure that the user identity you supply has the necessary permissions to access SQL Server. However, this does not apply for applications running under Internet and Information Services (IIS) such as ASP.NET. In order to get the necessary permissions to adapters hosted on web sites, use the following process:
- Open MMC either by right-clicking "My Computer" and selecting Manage, or by opening the console and typing "mmc".
- Expand the Services and Applications node. Expand the Internet and Information Services (IIS) Manager node.
- Right click the Application Pools node and select New -> Application Pool. Give the new application pool a name and click "OK".
- Right click the application pool you just created and select Properties. Go to the "Identity" tab and give the application pool an identity that is a member of the BizTalk Isolated Host Users group. Click "OK."
- Expand the Web Sites node. Expand the Default Web Site node (or the site under which your application is hosted).
- Right click the page and select Properties. On the "Virtual Directory" tab, select the application pool you just created from the drop down menu beside "Application Pool". Click "OK." Your web site now has the necessary access rights for the adapter to work.