Share this page

# jms_send_message_queue

Sends a message to a queue.

Web Services Functions (SOAP, WEB_SERVICE, Silverlight)

    int jms_send_message_queue( const char * StepName, const char * SentMessage, const char * SendQueueName);

This function returns LR_PASS (0) on success or LR_FAIL (1) on failure. Note that LR_PASS and LR_FAIL generally indicate whether the function call completed without an exception, and not that the test step succeeded.

All input string arguments (char type) except the step name can be parameterized using standard parameterization.

StepName | The name of the step, as it appears in the test tree. Any text can be used.
SentMessage | The message to send.
SendQueueName | The JNDI name of the send queue.

The jms_send_message_queue function sends a message to a queue.

VuGen identifies the queue by calling a lookup method on a JNDI context defined in the JMS runtime settings.

The message type is defined in the contentType message header. The default is a text message.

To set a JMS header or property for the next message to be sent, insert the jms_set_message_property function before this function.

This function fails, causing the script to stop (if the Continue on Error runtime setting is not selected) if:

- The JNDI context is incorrect.

- The queue cannot be located.

- The message is empty.

- A communication error occurs.

## Example

This example shows sending and receiving a message on a queue.

Copy code

    jms_set_message_property("step0: set the JMSType",
        "JMSType",
        "MyType");

    jms_send_message_queue("step1: send message",
        "Test Message",
        "TestJMSQueue");

    jms_receive_message_queue("step2: receive message",
        "TestJMSQueue");

    lr_message(lr_eval_string("{JMS_message}"));

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: