- 4 minutes to read

Example to find and view the Body/Payload from another BizTalk Log Event

A support engineer looking at a send port or orchestration event in BizTalk usually wants the message as it came in. This example adds a Search Field Link that opens the body of the received message in one click, from any later event of the same interchange.

A BizTalk event's Interchange Id link opens the received message, animated walkthrough (7.12)
Animated walkthrough: a Log View finds the events of one interchange, and the Received message link on the send port event opens the order as the receive location got it.

Understanding the Flow

Two facts make the link work:

  • For a BizTalk event, Nodinite stores BizTalk's MessageID of the tracked message as the Log Event's message id.
  • BizTalk writes the context property http://schemas.microsoft.com/BizTalk/2003/system-properties#InterchangeID on every message of an interchange. Its value is the MessageID of the interchange's first message: the message as it was received.

So a Search Field that extracts the InterchangeID holds, on every event of the interchange, the message id of the received message. The link hands that id to the Web Client action Message/FindAndView, which opens the message body.

graph LR A["fa:fa-magnifying-glass Log View
BizTalk Interchange Id value"] -->|"click the link"| B["fa:fa-link Search Field Link
URL with {value}"] B --> C["fa:fa-globe Web Client
Message/FindAndView"] C -->|"search"| D["fa:fa-database Active and older
Log Databases"] D --> E["fa:fa-file-code Body of the
received message"] style A fill:#2678BD,color:#fff style B fill:#2678BD,color:#fff style C fill:#E47528,color:#fff style D fill:#3F827B,color:#fff style E fill:#93d16d,color:#000

Diagram: the user clicks a BizTalk Interchange Id value in a Log View (blue); the Web Client action (orange) searches the Log Databases (teal) and opens the body of the received message (green).

How Message/FindAndView Finds the Body

Part What it does
messageId A Nodinite message id, a GUID. With or without braces ({4F4B9ECB-…}) works; the link URL-encodes {value}. Any other value is refused.
Log Databases The action searches the active Log Database and, when needed, the older ones. The response carries the HTTP header Nodinite-LogDatabaseId with the Id of the Log Database it found the body in; you don't set it.
logViewId The Log View the body is read through. The user who clicks the link needs the View Body permission (or Repair) on that Log View, see Permission Set for Log Views. logViewId=0 is the Administrators' view: only Administrators can open it.

Example API call

/Message/FindAndView?logViewId=4122&messageId={4F4B9ECB-0DE8-49C5-A00F-E04226677023}

Replace 4122 with the Id of a Log View your readers have View Body on.

  1. Create a Text Search Field, here BizTalk Interchange Id, with a Message Context Key expression on http://schemas.microsoft.com/BizTalk/2003/system-properties#InterchangeID for the BizTalk Message Types you log, for example Unparsed Interchange and Serialized Interchange. The Search Field Wizard does it from a logged event; its Test step shows the value.

    Search Field Wizard Test step for the BizTalk Interchange Id Search Field: a Message Context Key expression on the InterchangeID context property with one unique match (7.12)
    The Test step for BizTalk Interchange Id on the Message Type Serialized Interchange: one unique match, the braced GUID. The Message Context tab below holds the event's context properties.

    Message Context rows of the same event around the InterchangeID context property (7.12)
    The Message Context tab further down: the InterchangeID next to the send port name INT001: Send Order and the receive location INT001: Receive Order from Service Bus Queue.

  2. In the Search Field editor, add a Search Field Link (see Add or manage Search Field): a clear Name, such as Received message, and the address of the Nodinite Web Client, which runs at the root of its own web site, followed by Message/FindAndView. The host and port come from your environment's settings in the Nodinite Portal (Servers step). For external access, use the DNS or server name instead of localhost.

    https://nodinite.contoso.com/Message/FindAndView?logViewId=4122&messageId={value}
    
  3. Re-index the BizTalk Message Types, so events logged before the Search Field existed get a value too (see How a Re-Index Runs).

  4. Add the Search Field to a Log View, as a search field, a column, or both (see Add or manage Log View).

Open the Received Message

The walkthrough at the top of the page, step by step:

  1. In the Log View, type the interchange's GUID in BizTalk Interchange Id and click Search.
  2. The result lists the interchange's events, such as the order BizTalk sent on INT001: Send Order, each with its BizTalk Interchange Id.
  3. The value is a Search Field Link, Received message: click it.
  4. A new tab opens with the order as INT001: Receive Orders received it.

Next Steps