可以在管道组件中访问 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;
}
有关管道组件的详细信息,请参阅 开发自定义管道组件。