Access message properties inside custom pipeline component

Just recently I was looking for some default message properties and how to read and write them inside a custom pipeline component. While searching I stumbled over a great post listing all the default message properties and how to read them.

If you want to access the properties in your custom pipeline component, you have to get the IBaseMessageContext object from the IBaseContext and use the Read method to get a value or theWrite method to substitute a value with your own.

For example:

public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg)

{

IBaseMessageContext context = pInMsg.Context;

string value = context.Read(property, namespace).ToString();
context.Write(property, namespace, value);

}

To make your life a little easier, here’s the full list of properties:

Receive pipeline properties:

******Property****Namespace**
1 ReceivedFileNamehttp://schemas.microsoft.com/BizTalk/2003/file-properties
2 InboundTransportLocationhttp://schemas.microsoft.com/BizTalk/2003/system-properties
3 InterchangeIDhttp://schemas.microsoft.com/BizTalk/2003/system-properties
4 ReceivePortIDhttp://schemas.microsoft.com/BizTalk/2003/system-properties
5 ReceivePortNamehttp://schemas.microsoft.com/BizTalk/2003/system-properties
6 WasSolicitResponsehttp://schemas.microsoft.com/BizTalk/2003/system-properties
7 AuthenticationRequiredOnReceivePorthttp://schemas.microsoft.com/BizTalk/2003/system-properties
8 InboundTransportTypehttp://schemas.microsoft.com/BizTalk/2003/system-properties
9 LRPMsgBodyTrackinghttp://schemas.microsoft.com/BizTalk/2003/system-properties
10 MessageExchangePatternhttp://schemas.microsoft.com/BizTalk/2003/system-properties
11 PortNamehttp://schemas.microsoft.com/BizTalk/2003/messagetracking-properties
12 ReceivePipelineIDhttp://schemas.microsoft.com/BizTalk/2003/system-properties
13 MessageTypehttp://schemas.microsoft.com/BizTalk/2003/system-properties
14 SchemaStrongName[http://schemas.microsoft.com/BizTalk/2003/system-properties](http://schemas.microsoft.com/BizTalk/2003/system-properties)
Send pipeling properties:
******Property****Namespace**
1 CopyModehttp://schemas.microsoft.com/BizTalk/2003/file-properties
2 LTPMsgBodyTrackinghttp://schemas.microsoft.com/BizTalk/2003/system-properties
3 ReceivedFileNamehttp://schemas.microsoft.com/BizTalk/2003/file-properties
4 SPIDhttp://schemas.microsoft.com/BizTalk/2003/system-properties
5 ActualRetryCounthttp://schemas.microsoft.com/BizTalk/2003/system-properties
6 FileNamehttp://schemas.microsoft.com/BizTalk/2003/file-properties
7 PartyNamehttp://schemas.microsoft.com/BizTalk/2003/messagetracking-properties
8 ReceivePortNamehttp://schemas.microsoft.com/BizTalk/2003/system-properties
9 WasSolicitResponsehttp://schemas.microsoft.com/BizTalk/2003/system-properties
10 AllowCacheOnWritehttp://schemas.microsoft.com/BizTalk/2003/file-properties
11 RetryIntervalhttp://schemas.microsoft.com/BizTalk/2003/system-properties
12 OutboundTransportCLSIDhttp://schemas.microsoft.com/BizTalk/2003/system-properties
13 SPNamehttp://schemas.microsoft.com/BizTalk/2003/system-properties
14 InboundTransportLocationhttp://schemas.microsoft.com/BizTalk/2003/system-properties
15 InterchangeIDhttp://schemas.microsoft.com/BizTalk/2003/system-properties
16 ReceivePortIDhttp://schemas.microsoft.com/BizTalk/2003/system-properties
17 SPTransportIDhttp://schemas.microsoft.com/BizTalk/2003/system-properties
18 TransmitPipelineIDhttp://schemas.microsoft.com/BizTalk/2003/system-properties
19 AuthenticationRequiredOnReceivePorthttp://schemas.microsoft.com/BizTalk/2003/system-properties
20 InboundTransportTypehttp://schemas.microsoft.com/BizTalk/2003/system-properties
21 LRPMsgBodyTrackinghttp://schemas.microsoft.com/BizTalk/2003/system-properties
22 MessageExchangePatternhttp://schemas.microsoft.com/BizTalk/2003/system-properties
23 OutboundTransportLocationhttp://schemas.microsoft.com/BizTalk/2003/system-properties
24 PortNamehttp://schemas.microsoft.com/BizTalk/2003/messagetracking-properties
25 ReceivePipelineIDhttp://schemas.microsoft.com/BizTalk/2003/system-properties
26 SourcePartyIDhttp://schemas.microsoft.com/BizTalk/2003/system-properties
27 MessageTypehttp://schemas.microsoft.com/BizTalk/2003/system-properties
28 OutboundTransportTypehttp://schemas.microsoft.com/BizTalk/2003/system-properties
29 PartNameshttp://schemas.microsoft.com/BizTalk/2003/messageagent-properties
30 RetryCounthttp://schemas.microsoft.com/BizTalk/2003/system-properties
31 SchemaStrongNamehttp://schemas.microsoft.com/BizTalk/2003/system-properties