Creating a service test for WebSphere Java MQ

To test Java-based applications, create a service test and add the WebSphere Java MQ messages. You can create a service test by using Generic Service Client option Open Generic Service Client or the New Service Test wizard Create a Service Test.

Before you begin

Connect to a WebSphere MQ server.

If you are using Secure Sockets Layer (SSL) authentication, ensure that you have any required key files in your workspace.

If you are using SOAP security, ensure that you have configured the environment with the correct libraries and configuration files.

Procedure

  1. In the workbench, click File > New > Other > Test > Test Assets > Web Service Test or click Create a Service Test Create a Service Test icon.
  2. Select a project, and then, in Test file name, type a name for the test.
    The name that you type is the base name for the recording, test, and other required files. You see these files in the standard Navigator or the Java Package Explorer with their distinguishing suffixes, but you see only the simple test name in the Test Navigator.
  3. In the Select a service request interface page, complete one of the following steps:
    1. To test a service that use a WSDL file, select Web service request or Specification-based structure, click Next, and select a WSDL file.
    2. To test a service that does not use a WSDL file, select XML Request, Text Request, Binary Request or an Empty test.
  4. Click Next, select the WebSphere Java MQ protocol, and specify a transport configuration. If necessary, click New to create the transport configuration for the call. See Creating a WebSphere Java MQ transport configuration.
  5. Complete the following information in the General tab:
    Learn more about the UI elements in the General tab:
    Queue
    Name of the queue as defined on the WebSphere MQ server.
    Message type
    The types of messages are these:
    • Datagram means that the message does not require a reply.
    • Request means that the message requires a reply.
    • Reply means that the message is a reply to an earlier request message.
    • Report means that the message is reporting on some expected or unexpected occurrence, usually related to some other message. An example is a request message that contained data that was not valid.
    Message Persistence

    This value indicates whether the message is persistent or not. If the message is persistent, it survives the system failures and restarts of the queue manager. If the message is not persistent, it survives a restart if it is present on a queue having the NPMCLASS(HIGH) attribute. However, even with the NPMCLASS(HIGH) attribute a message does not survive a QMGR class. Nonpersistent messages on queues having the NPMCLASS(NORMAL) attribute are discarded at queue manager restart, even if the message is found on the auxiliary storage during the restart procedure.

    Dynamic Reply
    Select this check box for the WebSphere MQ server to dynamically create a temporary queue as a reply. If this check box is not selected, the message in Reply Queue is used.
    Reply Queue

    This is the name of the message queue to which the application that issued the get request for the message should send the reply and report messages.

    Reply Manager

    This is the name of the queue manager on which the reply-to queue is defined.

    Additional properties
    Specify the additional properties for the queues.
  6. Optional: If necessary, complete the following information on the Config tab:
    Learn more about the UI elements in the Config tab:
    Message Priority

    This is the priority of the message. The lowest priority is 0.

    Encoding

    This is the numeric encoding of numeric data in the message. This value does not apply to numeric data in the MQMD structure itself.

    Expiry Interval

    This is the period of time, in tenths of a second, after which the message becomes eligible to be discarded if it has not already been removed from the target queue. The expiry interval is set by the application that put the message.

    Character set

    This is the character set identifier of the character data in the application message data.

  7. Optional: In the Report tab, select the report messages to receive.
  8. Optional: If necessary, complete the following information in the Context tab:
    Learn more about the UI elements in the Context tab:
    Application Identity Data

    This information is defined by the application suite. Use it to provide information about the message or its originator.

    Application Origin Data

    This information is defined by the application suite. Use it to provide additional information about the origin of the message.

    Accounting Token

    This information is needed by the application to appropriately charge for the work that is done as a result of the message.

    User ID

    This is the user identifier of the application that originated the message.

  9. Optional: In the Identifiers tab, for the messages that require binary input, specify the ID in the string format in the second column. The first column is filled automatically in the hexadecimal format.
  10. Optional: In the Segmentation tab, select the segment of the message and click Next.
  11. If you had selected XML Request, click Next, select a XSD file and click Finish.
    The new service test is created.

What to do next

You can now enhance the test and run it.