Recording a service test with the generic service client
You can record a service test by invoking service requests with the generic service client. After you have sent the requests and received the responses from the service, select the results in the History section of the generic service client to generate a test. If you do not have access to a dedicated client for the service calls, the generic service client is the easiest way to generate the calls and to record a test.
Before you begin
If you are testing a SOAP-based web service, ensure that you have access to a valid Web Services Description Language (WSDL) file. The wizard can import WSDL files from the workspace, the file system, a remote repository, or from a URL. Ensure that the WSDL files use the correct syntax for the test environment. The generic service client might not work with some WSDL files.
If you are using Secure Sockets Layer (SSL) authentication, ensure that you have the 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.
If the response in a recording or test generation is in XML and the size of the XML data is higher than the value set in the XML Message Received maximum length field, the response is automatically converted to text to avoid any memory issues. To convert the full response to text, the tool checks the value set for Text Message Received maximum length. If the value is lesser than the size of the response, the response is truncated. If you want the response to be in XML when the response size exceeds the value set in XML Message Received maximum length, you can manually increase the value for both recording and test generation. To change the value for recording, click . To change the value for test generation, click .
About this task
You can record and generate a test by using REST APIs. The API documentation to record a test is located at Install_directory\IBM\IBMIMShared\plugins\com.ibm.rational.test.lt.server.recorder.jar. The API documentation to generate a test after the recording completes is located at C:\Program Files\IBM\IBMIMShared\plugins\com.ibm.rational.test.lt.server.testgen.jar.
To use a WS-SecurityPolicy that is included in a WSDL or an external XML file, you need to configure the security policy as described in Using a security policy. If a recording contains the Security Assertion Markup Language (SAML) token, the WS Security policy file must rely on the Service Token Service (STS) that produces the token. This token can then be used for encryption or other purposes as was designed.
<sp:SupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<wsp:Policy>
<sp:IssuedToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
<sp:Issuer>
<Address xmlns="http://www.w3.org/2005/08/addressing">http://9.143.105.204:8080/axis2/services/STS</Address>
</sp:Issuer>
<sp:RequestSecurityTokenTemplate>
<t:TokenType xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust">http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0</t:TokenType>
<t:KeyType xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust">http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey</t:KeyType>
<t:KeySize xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust">256</t:KeySize>
</sp:RequestSecurityTokenTemplate>
<wsp:Policy>
<sp:RequireInternalReference/>
</wsp:Policy>
</sp:IssuedToken>
</wsp:Policy>
</sp:SupportingTokens>
Procedure
- In the Performance Test perspective, click the New Test from Recording toolbar button or click .
- In the New Test from Recording wizard,
click Create a test from a new recording, select Service
Test, and click Next.If you are recording sensitive data, you can select a Recording encryption level.
- On the Select Location page, select
the project and folder where you want to create the test, type a name
for the test, and click Next.If necessary, click Create Parent Folder to create a project or folder
- On the Select Location page, select Generic
Service Client. This option uses the generic service client if you do not have access to a dedicated client for the service calls. See Recording a service test through a client program for information about using other client programs to record the test.
- Click Next. If this is the first
time you are recording a web service test, read the Privacy Warning,
select Accept, and click Finish to
proceed.The generic service client opens.
- If your service uses a transport or authentication protocol that requires overriding the default settings, then click the Transport tab and create an HTTP, Java™ Message Service (JMS), IBM® WebSphere® MQ, IBM® WebSphere® Java MQ, or Java MQ transport.
- Click the Requests tab.
- Right-click WSDLs and select one of the options to get the WSDL file.
- Right-click WADLs and select one of the options to get the WADL file.
- Right-click Endpoints and select one of the options to send the request.
See Sending service requests with the generic service client for more information about using the generic service client. - After creating the call, click the Edit Data arrow to change the details of the call if necessary.
- Click the Invoke arrow to invoke
the service call.If the call was successful, the response is displayed under the View Response arrow.
- To record a test with multiple calls, repeat steps 6 through 9.
- When you have finished sending service requests, stop the
recorder. You can do this by closing the generic service client or
by clicking the Stop push button in the Recorder
Control view.If you changed the network settings of the client program as described in step 8, you can revert to the default settings before closing the program.The Generate Service Test wizard opens.
- Click Finish.