您可以在管線元件中存取 SOAP 標頭內容屬性。 您可以使用內容屬性名稱和目標命名空間 http://schemas.microsoft.com/BizTalk/2003/SOAPHeader的組合。
下列程式代碼範例會取得 屬性 OrigDest 之接收管線元件中的要求 SOAP 標頭:
public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg)
{
try
{
string stringVar = inmsg.Context.Read("OrigDest", "http://schemas.microsoft.com/BizTalk/2003/SOAPHeader").ToString();
}
catch (Exception ex)
{
throw new Exception("Pipeline component exception - " + ex.Message);
}
return inmsg;
}
如需管線元件的詳細資訊,請參閱 開發自定義管線元件。