Accessing SOAP Headers in Pipeline Components
You can access SOAP header context properties in pipeline components. You use a combination of the context property name and the target namespace http://schemas.microsoft.com/BizTalk/2003/SOAPHeader
.
The following code example gets the request SOAP header in a receive pipeline component for the property OrigDest:
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;
}
For more information about pipeline components, see Developing Custom Pipeline Components.