Accessing and Listing Message Context Properties in Pipeline Components
Stephen Kaufman has in a blog listed all message properties that you can access when you are in a pipeline component. I have recently needed to use some of these properties so I wrote the code below which lists all context properties. The call to ctx.Read is how you access the information in the property.
IBaseMessageContext ctx = inmsg.Context;
string name;
string nspace;
for (int loop = 0; loop < ctx.CountProperties; loop++)
{
ctx.ReadAt(loop, out name, out nspace);
string value = ctx.Read(name, nspace).ToString();
System.Diagnostics.Trace.WriteLine(name + "\t\t" + nspace + "\t\t" + value);
}
When I compared the lists generated from my receive and send pipelines I noticed that they were different from Stephen's. My guess is that the reason for this is that his list was generated on BizTalk 2004 while my list is generated on BizTalk 2006. The following tables list all properties that I found (as the File adapter was used for these tests there are a few File adapter-specific properties included). You may note that the properties is sorted by namespace, this is not my doing because this is the order in which they were printed!
For each property I list if the property is new or not, the name, the namespace, and a sample value. The sample value is to help you understand what type of information the property contains.
Receive Pipeline Properties
There are now 19 properties in the receive pipeline, one deleted and six new. Please note that MessageType, SchemaStrongName and SourceCharset only appears after the Disasseble stage has been executed. If you grab the context in the Decode stage of the receive pipeline these properties will be missing!
Note that the WasSolicitResponse property that Stephen listed has are not present in this list! If they have been removed or if the are missing for some other reason I do not know.
Status | Property Name | Property Namespace | Sample Value |
New | FileCreationTime | https://schemas.microsoft.com/BizTalk/2003/file-properties | 2006-08-09 12:39:26 |
ReceivedFileName | https://schemas.microsoft.com/BizTalk/2003/file-properties | C:\Temp\In\{AC08712D-D3D3-4563-B3FA-7D4D16AF204E}.xml | |
New | ActivityIdentity | https://schemas.microsoft.com/BizTalk/2003/messagetracking-properties | {5AFF4DA8-01F8-475D-833C-B5F2B4EB90C0} |
New | AdapterReceiveCompleteTime | https://schemas.microsoft.com/BizTalk/2003/messagetracking-properties | 2006-08-09 12:39:27 |
PortName | https://schemas.microsoft.com/BizTalk/2003/messagetracking-properties | LoggerTest | |
InboundTransportLocation | https://schemas.microsoft.com/BizTalk/2003/system-properties | C:\Temp\In\*.* | |
InterchangeID | https://schemas.microsoft.com/BizTalk/2003/system-properties | {719EC689-6B8D-43C0-A22C-D30D5FB91AF7} | |
New | ReceiveInstanceID | https://schemas.microsoft.com/BizTalk/2003/system-properties | {0F014418-E50E-4696-A799-909CA49D57B5} |
New | ReceiveLocationName | https://schemas.microsoft.com/BizTalk/2003/system-properties | LoggerTest |
ReceivePortID | https://schemas.microsoft.com/BizTalk/2003/system-properties | {753B1829-8B4B-4DBF-AEAE-B40CB39D9F38} | |
ReceivePortName | https://schemas.microsoft.com/BizTalk/2003/system-properties | LoggerTest | |
AuthenticationRequiredOnReceivePort | https://schemas.microsoft.com/BizTalk/2003/system-properties | False | |
InboundTransportType | https://schemas.microsoft.com/BizTalk/2003/system-properties | FILE | |
LRPMsgBodyTracking | https://schemas.microsoft.com/BizTalk/2003/system-properties | 0 | |
MessageExchangePattern | https://schemas.microsoft.com/BizTalk/2003/system-properties | 1 | |
ReceivePipelineID | https://schemas.microsoft.com/BizTalk/2003/system-properties | {19002860-A279-4F4F-8FD3-5BCD7FC3B646} | |
MessageType | https://schemas.microsoft.com/BizTalk/2003/system-properties | https://LoggerTest.Schema1#Root | |
SchemaStrongName | https://schemas.microsoft.com/BizTalk/2003/system-properties | LoggerSchemas.LoggerSchema, LoggerSchemas, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8136305dbdd920be | |
New | SourceCharset | https://schemas.microsoft.com/BizTalk/2003/xmlnorm-properties | utf-8 |
Send Pipeline Properties
In the send pipeline I now find 42 properties! 15 is new and 4 has been removed.
Note that the PartyName, RetryInterval, WasSolicitResponse and SourcePartyID properties that Stephen listed has are not present in this list! If they have been removed or if the are missing for some other reason I do not know. The reason for two of the deleted properties may be that I did not use a Party Resolution stage in the receive pipeline, but I do not find it interesting to amend my tests with this right now...
Status | Property Name | Property Namespace | Sample Value |
CopyMode | https://schemas.microsoft.com/BizTalk/2003/file-properties | 1 | |
New | FileCreationTime | https://schemas.microsoft.com/BizTalk/2003/file-properties | 2006-08-09 12:56:53 |
ReceivedFileName | https://schemas.microsoft.com/BizTalk/2003/file-properties | C:\Temp\In\{AC08712D-D3D3-4563-B3FA-7D4D16AF204E}.xml | |
AllowCacheOnWrite | https://schemas.microsoft.com/BizTalk/2003/file-properties | False | |
FileName | https://schemas.microsoft.com/BizTalk/2003/file-properties | %MessageID%.xml | |
New | UseTempFileOnWrite | https://schemas.microsoft.com/BizTalk/2003/file-properties | False |
PartNames | https://schemas.microsoft.com/BizTalk/2003/messageagent-properties | System.String[] | |
New | ActivityIdentity | https://schemas.microsoft.com/BizTalk/2003/messagetracking-properties | {DE53D9D4-B8D8-431C-B330-A9EB578CC2FB} |
New | AdapterReceiveCompleteTime | https://schemas.microsoft.com/BizTalk/2003/messagetracking-properties | 2006-08-09 12:56:54 |
PortName | https://schemas.microsoft.com/BizTalk/2003/messagetracking-properties | LoggerTest | |
New | BAMTrackingNeeded | https://schemas.microsoft.com/BizTalk/2003/system-properties | False |
LTPMsgBodyTracking | https://schemas.microsoft.com/BizTalk/2003/system-properties | 0 | |
SPID | https://schemas.microsoft.com/BizTalk/2003/system-properties | {06775E3D-7CE7-4275-B415-ABACA7F65F8C} | |
ActualRetryCount | https://schemas.microsoft.com/BizTalk/2003/system-properties | 0 | |
New | OrderedDelivery | https://schemas.microsoft.com/BizTalk/2003/system-properties | False |
ReceivePortName | https://schemas.microsoft.com/BizTalk/2003/system-properties | LoggerTest | |
New | RouteMessageOnFailure | https://schemas.microsoft.com/BizTalk/2003/system-properties | False |
New | InterchangeSequenceNumber | https://schemas.microsoft.com/BizTalk/2003/system-properties | 1 |
New | IsSolicitResponse | https://schemas.microsoft.com/BizTalk/2003/system-properties | False |
New | OutboundProcessingStartTime | https://schemas.microsoft.com/BizTalk/2003/system-properties | 11432999 |
New | RetryInterval | https://schemas.microsoft.com/BizTalk/2003/system-properties | 5 |
New | StopSendingOnFailure | https://schemas.microsoft.com/BizTalk/2003/system-properties | False |
OutboundTransportCLSID | https://schemas.microsoft.com/BizTalk/2003/system-properties | {9D0E4341-4CCE-4536-83FA-4A5040674AD6} | |
SPName | https://schemas.microsoft.com/BizTalk/2003/system-properties | LoggerTest | |
InboundTransportLocation | https://schemas.microsoft.com/BizTalk/2003/system-properties | C:\Temp\In\*.* | |
InterchangeID | https://schemas.microsoft.com/BizTalk/2003/system-properties | {B024B2BB-9287-4883-97D7-C4670E003D01} | |
New | ReceiveLocationName | https://schemas.microsoft.com/BizTalk/2003/system-properties | LoggerTest |
ReceivePortID | https://schemas.microsoft.com/BizTalk/2003/system-properties | {753B1829-8B4B-4DBF-AEAE-B40CB39D9F38} | |
New | SPLastUpdatedTime | https://schemas.microsoft.com/BizTalk/2003/system-properties | 2006-08-09 09:35:18 |
SPTransportID | https://schemas.microsoft.com/BizTalk/2003/system-properties | {260F8795-74FA-447A-9B7A-0435B0FBD97E} | |
TransmitPipelineID | https://schemas.microsoft.com/BizTalk/2003/system-properties | {ACDFD936-83A6-4088-97D5-DD1B2327CD29} | |
AuthenticationRequiredOnReceivePort | https://schemas.microsoft.com/BizTalk/2003/system-properties | False | |
InboundTransportType | https://schemas.microsoft.com/BizTalk/2003/system-properties | FILE | |
LRPMsgBodyTracking | https://schemas.microsoft.com/BizTalk/2003/system-properties | 0 | |
MessageExchangePattern | https://schemas.microsoft.com/BizTalk/2003/system-properties | 3 | |
OutboundTransportLocation | https://schemas.microsoft.com/BizTalk/2003/system-properties | C:\Temp\Out\%MessageID%.xml | |
ReceivePipelineID | https://schemas.microsoft.com/BizTalk/2003/system-properties | ||
MessageType | https://schemas.microsoft.com/BizTalk/2003/system-properties | https://LoggerTest.Schema1#Root | |
OutboundTransportType | https://schemas.microsoft.com/BizTalk/2003/system-properties | FILE | |
RetryCount | https://schemas.microsoft.com/BizTalk/2003/system-properties | 3 | |
SchemaStrongName | https://schemas.microsoft.com/BizTalk/2003/system-properties | LoggerSchemas.LoggerSchema, LoggerSchemas, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8136305dbdd920be | |
New | SourceCharset | https://schemas.microsoft.com/BizTalk/2003/xmlnorm-properties | utf-8 |
Comments
- Anonymous
December 07, 2010
hi Mattias, Nice article to start with. One discrepancy I found was.. I have read the properties from the Decode stage and I got a couple of properties there itself.. The xml that I have given has no corresponding valid schema deployed. But you have specified that the properties would be blank unless the dissambler stage has passed. Could you please further explain your statement. ReceiveLocationName:schemas.microsoft.com/.../system-properties:Receive Location1 Regards Praveen.