More on the Commerce Server BizTalk Adapters – General How-To’s

To keep on the Commerce Server Adapter line of blog posts here is another minor pain point I ran into.

I was setting up the Commerce Server Catalog Send Adapter on a multi-server BizTalk Environment.  I opened up BizTalk Admin and configured the Send Port.

I went to run the solution and I received the following error:

“Failed to create Catalog  Context in ‘Commerce Server Catalog Send Adapter’. Message:”

Turns out that the Send Host for the Catalog Adapter was running on another Server so the registry subkey was missing.  Oh, and since this was also a 64-bit Host the keys were written in the wrong place – same as the Orders Adapter.

To fix this, all I had to do was open the Send Port on the other Server and click OK.  This created the registry key.  Then, I simply had to move it into the correct location.

Here are some general How To’s I’ve put together when working (mostly when configuring) with the Commerce Server Adapters:

1.  Always create Send and Receive Ports on the Servers you intend to run them on.  (Not sure what happens when you import an MSI – will get to that soon)

2.  Do not expect any of the Adapters to work in a BizTalk Group scenario.  In fact, disastrous results may occur if ran in Group Scenarios. (Hope to test clustering the service soon). 

FACT: Catalog and Orders do not operate in Group Scenario.  See the help guide for more info.

3.  Expect manual configuration if working with 64-bit hosts.

4.  Make sure you read the Commerce Server 2007 help guide including “Performance Considerations for the BizTalk Adapters” and “Concurrency Issues with the BizTalk Adapters” and “Troubleshooting the BizTalk Adapters” sections.

5.  Remember how easy it is to set up and work with the Adapters! :).  All in all, they provide us a lot of great benefits!

More to come as I continue to work with the Adapters.

Follow-up on Commerce Server Orders Receive Adapter

Just wanted to post a few follow ups to my post last week on the Commerce Server Orders Receive Adapter running in a 64-bit host.

During testing on another server, I received the following error: “Failed opening or reading the Registry subkey: Software\Microsoft\Commerce Server 2007 BizTalk Adapters\Orders\<somekey>.  Message: Requested registry access is not allowed.”

This was because when I created the new registry key, I did not give the host user permission to access it.  So make sure to do so when adding this key.

Also, something else I discovered that is applicable to both 32-bit and 64-bit hosts of the receive adapter is that the Receive Adapter will double process orders when running the host on two separate BizTalk Servers – i.e. you make it highly available.  I think the help guide talks about this a little but it was not very clear.

I would guess you’d need to cluster this service to achieve high availability.  But I haven’t tested that out yet.  Nor do I know how the locally written registry key would come into play.

Commerce Server Orders Adapter on 64-bit BizTalk in a 64-bit Host

Recently I have spent a lot of time working with the Commerce Server 2007 Orders Adapters for BizTalk. 

Getting it set-up and running on a single machine with BizTalk and Commerce Server together was not too hard (although anyone who thought BizTalk 2004 was hard to install should try installing Commerce Server).  Getting everything to work correctly on a 64-bit BizTalk Server installation was another story.

I was running BizTalk 2006 R2 64-bit with a 64-bit process Host.  I was setting up the Commerce Server Order Receive Adapter just like I had many times, only to receive the following two errors:

90% of the time:

Access to the registry key ‘HKEY_LOCAL_MACHINE\Software\Microsoft\Commerce Server 2007 BizTalk Adapters\Orders\<some key>’ is denied.

10% of the time:

The Messaging Engine failed to update the configuration for the receive location “Receive Location1” with URL “<some address>” for adapter “Commerce Server Orders”. Reason: “Object reference not set to an instance of an object.”.

For those of you who have not worked with the Orders Adapter before, when you create a new Receive Location the adapter creates a local registry key to use to store the last polling time.  When I set up this receive location, I checked the registry by doing a search for “<some key>”.  I found the key inside the registry and noticed it was automatically created for me by the BizTalk Adapter as it should have been.

So what was the registry permission problem?

This page in the Commerce Server 2007 help guide was helpful in finding the bug… I mean problem.  This states that on a 64-bit BizTalk Server, the Commerce Server Adapter uses two different registry locations depending on if your host is 32-bit or 64-bit.

For a 32-bit Host, the keys should be here:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Commerce Server 2007 BizTalk Adapters

For a 64-bit Host, the keys should be here:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Commerce Server 2007 BizTalk Adapters

Since my host is a 64-bit Host, the error message above is correct in the location it is looking for the registry settings. 

So what happened to the settings I saw in the registry?  It turns out they were put into the Wow6432Node and I did not notice the full path to the registry key.

The fix was simple.  All I had to do is move the keys the Adapter created in the incorrect location into the expected location for the 64-bit Host.  Note that this process will need to be done any time the Registry Key changes, which on a production server should be almost never or any time you add a new receive location.

To summarize:
When running a 64-bit Host with the Commerce Server Orders BizTalk Adapter, you need to move the auto created registry keys from the Wow6432Node location to the correct location.

Note that 32-bit Hosts running on 64-bit BizTalk Servers do not have any issues, nor do 32-bit BizTalk Servers.