Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

(Introduced in MSMQ 3.0.) The SoapHeader property of the MSMQMessage object specifies additional application-generated header elements for inclusion in the SOAP envelope of an SRMP message.

Data type: String
Run-time access: Write-only
Property SoapHeader As String  

Property Value

A String of Unicode characters that represents XML header elements for inclusion in the SOAP envelope of the SRMP message.


SoapHeader is used only when an application sends SRMP messages. When an SRMP message is sent, the sending queue manager appends the string of additional SOAP header elements specified in this property to the end of the Message Queuing-generated SOAP header portion of the SOAP envelope in the message. It then attaches the SOAP envelope, and when applicable, SOAP attachments to the message.

The string supplied to this property must contain only well-formed XML elements, because the SOAP header is used internally by Message Queuing. If anything introduced into this property is not well-formed XML, an MQ_ERROR_PROPERTY error will be returned when the message is sent.

To set additional application-generated SOAP body elements in the SOAP envelope, use the MSMQMessage.SoapBody property.

To retrieve the complete SOAP envelope, use the MSMQMessage.SoapEnvelope property.

To retrieve the entire contents of an SRMP message in the form of an array of bytes, including both the SOAP envelope and the SOAP attachments associated with it, use the MSMQMessage.CompoundMessage property.

In C++ COM applications, you must use a smart pointer to the IMSMQMessage3 interface to expose the SoapHeader property.

Equivalent API Function Property

With API function calls, the equivalent property is PROPID_M_SOAP_HEADER.


Windows NT/2000/XP: Included in Windows XP and Windows Server 2003.

Windows 95/98/Me: Unsupported.

Header: Declared in Mqoai.h.

Library: Use Mqoa.lib.

See Also