Edit a service stub
Service stubs are generated with a single default response for each operation in the WSDL specification. You can edit the service stub to...
- change the default responses
- add conditional responses that can simulate the actual service
To edit the behavior of a service stub:
- In the test navigator, double-click the stub to open the stub editor.
![]()
Each operation simulated by the stub is represented by an operation element, which contains Case elements that describe a condition. Each case contains a response element. Case elements are similar to test verification points and use the same presentation.
- To change the default response of an operation:
- Expand the operation and the Case : Default element, and then select the response element. The Case : Default element describes the response of the service stub when no other case condition is met.
- Edit the Message content to specify the XML content returned by the service stub.
- To add a conditional response case:
- Right-click the operation and select either...
Add | Stub Equals Case
Add | Stub Contains Case
Add | Stub Query Case
![]()
These conditional case types are similar to the Equals, Contain and Query verification points in service tests.
Equals Case The entire incoming message content fully matches the specified message content. Contains Case A portion of the incoming message content matches the specified message content. Query Case The XPath query meets the specified criteria. You can add as many case elements as necessary to simulate the behavior of the original service. Use the Up and Down buttons to change the order in which the case conditions are evaluated. Only the first matching condition is executed.
The default case cannot be removed and is always the last case element in the operation.
- Select the response element and edit the Message content to specify the XML content returned by the service stub.
![]()
Use the Form, Tree, and Source views to change the XML content display mode.
You can specify a request...
![]()
...and a response...
![]()
Here is another example...
![]()
![]()
Set a value for the default case...
![]()
- Select File > Save or click the Save toolbar button.
What to do next
When you have finished editing the service stub, you can deploy the stub to a stub server.
Related:
Service stub overview Create a service stub
Deploy service stubs
Add stub servers to a performance schedule
Record service stub activity in a log file
Error 404 - Not Found Error 404 - Not Found
The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.