Using Tracing to Track Down BizTalk Adapter Problems

When integrating Commerce Server 2009 R2 together with other systems by using the Commerce Server 2009 R2 adapters, you may want to trace the activity of the adapters. There are two parts to this tracing—tracing the Commerce Server 2009 R2 components and tracing in BizTalk Server.

Tracing the Commerce Server Components

The Commerce Server 2009 R2 adapters use the same tracing functionality as the rest of Commerce Server, with one minor difference. Whereas other Commerce Server 2009 R2 components use fixed GUIDs as their trace identifiers, the Commerce Server 2009 R2 adapters create a new trace GUID for each adapter endpoint that you create and configure. These dynamic trace GUIDs are stored in the registry for each endpoint under the registry sub key value that you provided as part of the endpoint configuration.

To trace a specific adapter endpoint, follow these steps:

  1. Get its trace GUID from the registry. Look in the following registry path to find and retrieve the relevant trace GUID:

    • x86: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CommerceServer\9.0\BizTalk Adapters\adapter_type\subkey\Trace Guid

    • x64 (running as a 32-bit process): HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CommerceServer\9.0\BizTalk Adapters

      In both cases, adapter_type is either Orders, Catalog, Inventory, or Profiles, and subkey is the value that you provided for the registry sub key transport property for the adapter endpoint.

  2. Open a Command Prompt window and set %Commerce_Server_Root%\Support as the current directory.

  3. To start a trace for a Commerce Server 2009 R2 adapter endpoint (with, for example, the GUID 43914661-5C3B-4ccb-BD14-7BC8CFB76E13), use the following command:

    tracelog -start AdapterTrace -f AdapterTrace.log -guid #43914661-5C3B-4ccb-BD14-7BC8CFB76E13 -flags 0x7F

    Note

    Replace this example GUID with the trace GUID you retrieved from the registry in step 1.

  4. Enable the corresponding adapter endpoint or submit an adapter message to generate trace data.

  5. When you are ready to stop this trace, use the following command:

    tracelog -stop AdapterTrace

    A file that is named AdapterTrace.log that contains your trace data was created in the current folder.

  6. In order to read the trace information, you must format it by using the following command:

    tracefmt AdapterTrace.log -tmf TraceFormat\CSTraceEvents.tmf

For more information about Commerce Server 2009 R2 tracing, see How to Trace Commerce Server Events.

Tracing within BizTalk Server

The BizTalk Server installation folder contains is a trace tool named Trace.cmd that uses standard Windows tracing technology. For more information, see the Using the BizTalk Adapter Trace Utility topic in the BizTalk Server Help. You can also run the trace command together with the -? option.

Last Run Times Written to the System Registry

Each Commerce Server 2009 R2 adapter records the date and time at which it last ran in its configured location in the system registry. This information may prove useful when tracking down issues related to the adapters. It is stored under the registry key DateTime Of Last Run in the registry location you have configured for the corresponding adapter endpoint using the transport property Registry Subkey. The value of this property is used to create a unique registry location for the endpoint within one of the following four registry locations, depending on the type of the adapter:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CommerceServer\9.0\BizTalk Adapters\Catalog

  • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CommerceServer\9.0\BizTalk Adapters\Inventory

  • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CommerceServer\9.0\BizTalk Adapters\Orders

  • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CommerceServer\9.0\BizTalk Adapters\Profiles

Note

When you run the BizTalk Server Host as a 64-bit process, the following warning appears in the event viewer for the first export operation you perform for each Commerce Server 2009 R2 adapter (Orders, Catalog, Inventory, and Profiles): "Could not find a date for 'Last Run' in the Registry. Using the date: .". This warning can be safely ignored and occurs because the adapter registry entries are originally created for 32-bit BizTalk Server Host processes. The first export operation for each adapter creates a Last Run registry entry in the appropriate registry location, and later export operations will not produce this warning.

See Also

Other Resources

Troubleshooting the BizTalk Adapters