The Messaging Client tool sends payloads over HTTP to the server. It is very useful for non-SOAP clients, such as XML servlets and proprietary web services that have their own specifications. It can be used to test a service, test the communication between the client and server, and check the content of the HTTP messages. In addition, the Messaging Client can be used for REST style services. For more information, see Testing RESTful Services. The REST Client tool can also be used to send messages to RESTful services. For more details, see REST Client.
To send a message using the Messaging Client tool, you need to tell SOAtest or Virtualize what message to send and how to send it. This is done by specifying the following parameters in the tool’s configuration panel.
This topic explains how to configure and apply the Messaging Client tool that sends HTTP messages to servers. Sections include:
General Options
Specifying options at the top of the configuration panel allows SOAtest and/or Virtualize to populate the Request tab with items that make it easier for you to specify the request message. You can specify the following schema settings:
- Schema URL: Describes the Schema URL where this service can be accessed. You can either enter a value or click Browse. If you do not have a schema, you can leave this field empty.
- Constrain to Schema: Determines whether certain parameters of the messaging tool obtain their values from the Schema rather than from manual entry. If this option is enabled, certain parameters (for example, router endpoint, SOAP action, SOAP body and header parameters) are disabled and get their values from the WSDL. If this option is disabled, the Refresh Schema button will also be disabled.
- Refresh Schema: Refreshes the schema from the given location URL and reparses it.
Request Options
From the Request tab of the Messaging Client tool, you can select input modes from the Input Mode menu. The Messaging Client tool shares Input Mode options with the SOAP Client tool and Message Stub tool. For more information on these shared options, see Input Modes. Note that in addition to the usual options, you can also use a table view, which is designed for posting form parameters. For details, see Table Input Options.
Transport Options
The Transport options allow you to determine whether the client sends requests using HTTP 1.0, HTTP 1.1, JMS, SonicMQ, IBM MQ, RMI, SMTP, TIBCO or a custom protocol. To configure the properties of each protocol, select the appropriate protocol from the Transport menu.
For more information, see the following sections:
- HTTP 1.0
- HTTP 1.1
- JMS
- IBM MQ
- SonicMQ
- RMI
- SMTP
- TIBCO Rendezvous
- Marketplace Extensions (for custom protocols)
Internal Transport for Client Tools
Clients chained to responders can route messages to virtual assets on the local server without consuming an HTTP connection by using localhost
, 127.0.0.1
, or the special host name host.virt.internal
. When using localhost
or 127.0.0.1
, the specified port must match the port Virtualize is deployed on; when using host.virt.internal
the port is not used. For example, a virtual asset deployed on http://localhost:9080/myVirtualAsset
can also be reached by a chained client using http://host.virt.internal/myVirtualAsset
.
Misc
The following options are available in the Misc tab of the Messaging Client tool:
- Valid HTTP Response Codes: Allows you to customize the tool behavior so that it succeeds with HTTP response codes outside the
2xx
range. Specify single codes and/or code ranges as a comma-separated list. For example, if you use "302, 500-599
", a302
code or any code in the 5xx range will be accepted. If you're using a parameterized value, be sure that the value in the data source uses this same format (for example, "302, 500-599
"). Timeout after (milliseconds): Specifies the length of delay (in milliseconds) after which your FTP, telnet, or HTTP requests should time out. The Default setting corresponds to the timeout set in the Preferences panel. The Custom setting allows you to enter a timeout. A non-positive timeout value can be entered to specify an infinite timeout.
- Fail the test on timeout: Select this option to fail the tool on the specified timeout.
- Pass the test only if a timeout occurred: Select this option to pass the tool if the specified timeout occurred (that is, tool did not finish execution within the specified time).
Outgoing Message Encoding: Choose Custom from the drop-down menu and choose an encoding for the outgoing message. The default is to use the encoding configured in the immediate parent test suite (see Specifying Client Options). You can also specify this option globally in the Parasoft Preferences Misc settings (see Additional Preference Settings).
Related Tutorials
The following tutorial lesson demonstrates how to use this tool: