receive

The receive service request is an http request message sent to the UMS in accordance with the Simple Messaging API or the XML Messaging API.

The receive request must conform to the following criteria:

Required field/attribute values | Optional field/attribute values
--- | ---
service=receive | sid
destination | user=guest (by default)
| password=guest (by default)
| domain=queue (by default)
| timeout (default is set to 7000 milli seconds)

Notes:
The value of the destination field/attribute is the mane of the JMS destination from which the message is to be received.

The value of the sid field/attribute is a secure token obtained from the previous login_reply response. If an sid value is present, the user and password field/attributes are ignored by UMS service. If a value is not present, the user and password field/attributes values can be provided to authenticate with JMS server, instead of using a login request. Applications use this feature when receiving a message only occasionally. Applications would normally use the login request to achieve better performance.

Service response message: receive_reply

1. Simple Messaging API Example:

The following is a receive request message to UMS.

POST /ums/simple?service=receive&destination=simpleMessagingQ&sid=6-LTgxMDczMTczNQ== HTTP/1.1
Content-Type: text/plain;charset=UTF-8
User-Agent: Java/1.6.0_07
Host: localhost:8888
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-Length: 0
2. XML Messaging API Example:

POST /ums/xml HTTP/1.1
Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Content-Type: text/xml; charset=utf-8
Content-Length: 439
SOAPAction: ""
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Java/1.6.0_07
Host: localhost:8888
Connection: keep-alive
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<ums:MessageHeader xmlns:ums="https://mq.java.net/ums" ums:id="1.0" ums:version="1.0">
<ums:Service
ums:service="receive"
ums:destination="XMLmessagingQ"
ums:domain="queue"
ums:sid="6-LTgxMDczMTczNQ== ”
ums:timeout="30000”/>
</ums:MessageHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body/>
</SOAP-ENV:Envelope>
Back to UMS protocol page.