次の方法で共有


HTTP Messages

 

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

MSMQ 3.0 provides support for referencing URL-named queues, creating SOAP-compliant (SRMP) messages that can be sent over HTTP, and authenticating HTTPS messages.

HTTP messages can be sent over an intranet to destination queues located on computers within an enterprise or over the Internet to queues.

To send messages to a destination queue over HTTP, the target computer must have the Message Queuing HTTP Support subcomponent and IIS installed. Access to the queue can be restricted to specific users by changing the permissions of the virtual directory in the IIS snap-in.

Destination queues for HTTP messages are opened using direct format names that include the URL address of the target computer, the virtual directory name, and the queue name separated by slashes. The default virtual directory name is msmq, but Message Queuing can be configured by IIS to use a different virtual directory. A direct format name containing HTTPS as the protocol name invokes a secure HTTP transport through a Secure Sockets Layer (SSL) connection.

Note

The format names used to send messages over the Internet must include the IP address or complete DNS name of the target computer, although the computer name is sufficient for sending messages within an enterprise. The following are some examples of direct format names for sending HTTP messages.

DIRECT=HTTP://157.18.3.1/msmq/MyQueue                 (Single computer or cluster)  
DIRECT=HTTP://Mike01/msmq/MyQueue                     (Within the enterprise)  
DIRECT=HTTP://www.northwindtraders.com/msmq/MyQueue   (Over the Internet)  
DIRECT=HTTPS://www.northwindtraders.com/msmq/MyQueue  (Over the Internet)  

HTTP format names can use forward slashes, "/", or backslashes, "\", to separate the elements of Message Queuing information (other format names require backslashes to separate these elements).

HTTP is automatically chosen as the transport for any Message Queuing message sent using an HTTP format name. In this case, the message will be formatted using the SOAP extensions for reliable messaging in the SOAP Reliable Messaging Protocol (SRMP).

Note

Messages stored in a queue cannot be read if the queue is opened using an HTTP direct format name.

A complete HTTP message includes a SOAP envelope and the SOAP attachments associated with it

The SOAP envelope includes a SOAP header and a SOAP body. The SOAP header contains all of the message properties encoded in SOAP and SRMP elements, and may contain additional XML-formatted information. These elements hold all the end-to-end information needed for reliable messaging. The SOAP body does not contain any Message Queuing-generated information, but may contain other XML-formatted information provided by the sending application.

Additional application-generated SOAP header elements are introduced into an HTTP message by including them in the PROPID_M_SOAP_HEADER or MSMQMessage.SoapHeader property, and application-generated SOAP body elements are introduced into an HTTP message by including them in the PROPID_M_SOAP_BODY or MSMQMessage.SoapBody property.

A complete HTTP message, including the SOAP envelope and the SOAP attachments associated with it, is retrieved from the PROPID_M_COMPOUND_MESSAGE or MSMQMessage.CompoundMessage property. The additional application-generated SOAP header elements can be retrieved from the PROPID_M_SOAP_ENVELOPE or MSMQMessage.SoapEnvelope property.

When sending an HTTP message, Message Queuing automatically transforms the individual binary message properties to specific WS-Routing elements, SRMP elements, and elements of the MSMQ namespace, and includes them in the header portion of the SOAP envelope. On the receiver side, Message Queuing maps these XML elements to the respective binary message properties before storing the message. The end-to-end semantics for transmitting message properties over a non-HTTP transport are preserved for messages sent over an HTTP transport. However, an HTTP message also maintains the XML elements specifying the message properties in the read-only PROPID_M_SOAP_ENVELOPE or MSMQMessage.SoapEnvelope property.

When authentication is requested, Message Queuing automatically signs HTTP messages using an XML Digital Signatures.

Note

Message Queuing cannot authenticate the sender of an HTTP message by comparing the SID of the user who registered the certificate attached to the message with the sender identifier because the sender identifier is not conveyed in HTTP messages. For information on the digital signature used to sign HTTP messages, see XML Digital Signatures.

Sending Message Queuing-encrypted or application-encrypted messages over HTTP/HTTPS transport is not supported.

The public, private, and direct format names of administration or response queues can be included in messages sent over HTTP. Conversely, the names of administration or response queues in HTTP format can be included in messages sent over an ordinary (non-HTTP) transport. However, the use of distribution lists and multiple-element format names for these purposes is not supported.

The host name and resource in the HTTP header are converted to UTF-8 format. This enables sending HTTP messages to computers and queues that have non-English Unicode names.

More Information

For information on See
How message properties are included in HTTP messages Message Properties in HTTP Messages
Protecting computers in an enterprise by using proxy servers and store-and-forward servers Delivering Messages Sent over the Internet