This topic explains how to record HTTP, JMS, and IBM MQ traffic for test generation purposes.
Sections include:
The traffic files generated by Parasoft Virtualize (through the thin client interface of CTP) can be used for test creation as well as virtual asset creation.
If you do not have Parasoft Virtualize, you can use SOAtest’s recording proxies to monitor and capture live HTTP, JMS, or IBM MQ traffic from a service as an application is exercised. These proxies can concurrently capture traffic that passes through multiple endpoints.
The recording proxy monitors traffic over the specified transport(s) as an application is exercised. SOAtest "listens" to traffic requests and responses, then builds a traffic file of legitimate request/response pairs. This traffic is then used to generate a test suite that represents the captured behavior in preconfigured test client tools.
JMS, IBM MQ, HTTP, HTTPS (SSL), Basic, Digest, and Kerberos authentication are supported; NTLM is not.
HTTP chunking and continue headers are not supported.
There are two main steps involved in recording and generating tests from traffic using this approach:
To capture live traffic across one or more endpoints:
When live traffic is being captured, you can switch between the available tabs to view the requests and responses at each endpoint.
Once traffic is captured, you have two options for generating tests:
This section explains how to configure recording proxies that send and receive messages over the HTTP transport.
HTTP, HTTPS (SSL), Basic, Digest, and Kerberos authentication are supported; NTLM is not.
In the recording proxy wizard, specify your HTTP settings as follows:
Due to the nature of SSL, SOAtest’s proxy for HTTP recording generates a dynamic server certificate signed by its own certificate authority. In order to accept this dynamic server certificate, the client generating the requests over HTTPS will need to be set up to trust all certificates. In addition, SOAtest must be configured to trust the certificate presented by the service. To do this:
Due to the nature of SSL, SOAtest’s proxy for HTTP recording generates a dynamic server certificate signed by its own certificate authority. In order to accept this dynamic server certificate, the client generating the requests over HTTPS will need to be set up to trust all certificates. In addition, SOAtest must be configured to trust the certificate presented by the service as well as to send the appropriate client certificate. To do this:
To generate a traffic file that captures HTTPS traffic from a service that uses server-side or two-way SSL, complete the wizard as described in Capturing the Traffic (above).
In the HTTP wizard page, be sure to enable the appropriate SSL option:
This section explains how to configure recording proxies that send and receive messages over the JMS transport.
Sections include:
See JMS Prerequisites.
When traffic is being exchanged over queues, the assumption is that there is a client application that sends a request to a client destination queue and a server application that receives that message from the queue, then sends another (reply) message onto a second queue for the client to receive.
With that scenario in mind, Parasoft SOAtest uses a "man-in-the-middle" (proxy) approach between the client and the server, so two extra queues are needed on the messaging provider in order to facilitate that mediation. SOAtest proxies will receive messages from where the client places them, record the message contents (if recording is enabled), then put the message on the queue where the server will receive it from. Similarly, the server sends the message to a queue where the proxy picks it up, records it (if recording is enabled), and places it back on the queue where the client is expecting the reply response.
As a result, it is necessary to allocate two additional queues and either:
Only one of the two application queues needs to be modified.
Specify your JMS settings as follows:
Specify whether you’re using JMS Queues or Topics, the Provider URL, Initial context, and connection factory (be sure to add the related jars to the SOAtest classpath), as well as any additional initial context JNDI properties, authentication, and the queues/topics you want to monitor to collect traffic.
This option specifies whether to use the message's JMSReplyToQueueName header to determine where the proxy sends the response. If Use JMSReplyToQueueName for Response is enabled, values from the incoming request will be used to determine where to send the response. If it is not enabled, the response will be sent to the queue specified in the UI; the values in the JMS message header will be ignored. |
This section explains how to configure recording proxies that send and receive messages over the IBM MQ transport.
Sections include:
See Adding Necessary Jar Files to the Classpath.
When traffic is being exchanged over queues, the assumption is that there is a client application that puts a request to a client destination queue and a server application that gets that message from the queue then puts another (reply) message onto a second queue for the client to get.
With that scenario in mind, Parasoft SOAtest uses a "man-in-the-middle" (proxy) approach between the client and the server, so two extra queues are needed on the messaging provider in order to facilitate that mediation. SOAtest proxies will receive messages from where the client places them, record the message contents (if recording is enabled), then put the message on the queue where the server will receive it from. Similarly, the server sends the message to a queue where the proxy picks it up, records it (if recording is enabled), and places it back on the queue where the client is expecting the reply response.
As a result, it is necessary to allocate two additional queues and either:
Only one of the two application queues needs to be modified.
Specify your IBM MQ settings as follows:
This option specifies whether to use the message’s replyToQueueName header to determine where the proxy sends the response. It impacts responses to IBM MQ messages of type MQMT_REQUEST. If Use replyToQueueName for Response is enabled, values from the incoming request will be used to determine where to send the response. If it is not enabled, the response will be sent to the queue specified in the UI. More specifically:
|
This section explains how to configure recording for IBM MQ and JMS point-to-point (when queues are used, not topics).
The method that Parasoft SOAtest uses for capturing/recording JMS point-to-point messaging and IBM MQ requires SOAtest to be a proxy or, in other words, an intermediary / man-in-the-middle.
Assume that there is a client/consumer application (we’ll call this "Client") that sends/puts/pushes a request message on destination queue REQUEST_QUEUE and receives/gets/pulls a response/reply from RESPONSE_QUEUE. Also assume there is a server/provider application (we’ll call this "Server") that receives/gets/pulls messages from REQUEST_QUEUE and sends/puts/pushes responses to RESPONSE_QUEUE.
There are two possible configuration scenarios for recording traffic. In one, you modify the queues that are used on the client application end. In the other, you modify the queues that are used on the server.
The best approach to use depends on your ability to access and modify each end. In both cases, you will need to create two extra queues in order to enable the recording process. Here, we’ll label them as PROXY_REQUEST_QUEUE and PROXY_RESPONSE_QUEUE.
If a publish and subscribe scheme is used (using Topics instead of queues), then you don’t need to introduce new topics into the system. That’s why only two destinations need to be provided in the wizard:
|
In this scenario, you need access to the client application deployment configuration in order to adjust the queues it uses. Modify the queues that the client uses to communicate with the server as follows:
The server does not need to have its queues changed in this case.
In the IBM MQ or JMS recording wizard, provide the queue names as follows:
Client Queues | |
---|---|
Destination/Put Queue | PROXY_REQUEST_QUEUE |
Reply to/Get Queue | PROXY_RESPONSE_QUEUE |
Server Queue | |
Reply to/Get Queue | REQUEST_QUEUE |
Destination/Put Queue | RESPONSE_QUEUE |
In this scenario, you need access to the server application deployment configuration in order to adjust the queues it uses. Modify the queues that the server uses to communicate with the client as follows:
The client does not need to have its queues changed in this case.
In the IBM MQ or JMS recording wizard, provide the queue names as follows:
Client Queues | |
---|---|
Destination/Put Queue | REQUEST_QUEUE |
Reply to/Get Queue | RESPONSE_QUEUE |
Server Queue | |
Reply to/Get Queue | PROXY_REQUEST_QUEUE |
Destination/Put Queue | PROXY_RESPONSE_QUEUE |