15 January 2008 - 2.0.1 |
MockServices are displayed in the navigator under their containing project node. They can be created in a number of ways;
After specifying a path and port to listen on, soapUI will create a MockService with a MockOperation corresponding to each of the specified interfaces operation. Each MockOperation will further be configured with a default MockResponse which will be created from the associated WSDL/Schema definition in the same manor as when importing interfaces and creating requests.
Once created, an arbitrary number of MockOperations can be added to a MockService, there is no requirement that all operations come from the same interface or that all operations from an interface be mocked. Just mock those operations that are required.
Right-clicking a MockService node in the navigator shows a popup menu
with the following actions:
| ![]() |
The bottom left details tab for a MockService displays the following properties:
The Test Properties tab contains the custom properties defined for this MockService | ![]() |
Double-clicking a MockService in the navigator opens the MockService editor as seen to the right.
From the top down the editor has the following parts: A Toolbar with the following options:
The list of MockOperations currently configured for this MockService. Right-clicking show the MockOperations available actions, double-clicking opens the MockOperation editor A rolling log of handled requests with a toolbar with the following options:
Double-clicking on an entry in the log displays the entire message exhange for that request as shown below: | ![]() |
Below the list of MockOperations there are 4 inspectors available (left to right):
The MockService Options dialog has the following options:
When starting the MockService using the Run toolbar button, soapUI starts a local http server (if not already running for another MockService) as configured in the MockService Options dialog. This can be seen in the soapUI-log as follows:
SOAP Requests can now be issued to the server from any client as if it were a "real" Web Service, the incoming requests will be dispatched to the matching MockService / MockOperation which will further dispatch as configured in Request Dispatching. While the MockService is running, it is still possible to add/remove MockOperations, MockResponses, etc... The only values that can not be changed are the path and port of the MockService, for this it is required to first stop the MockService and then start it again after changing as desired.
If an error occurs during request processing a SOAP Fault will be returned, for example in the following situation a request was issued from within soapUI that could not be matched to any available MockServices MockOperation:
When starting a MockService, the corresponding WSDL's and their referenced parts (WSDLs and XSDs) are made available via a local web interface. All includes/imports are rewritten to references the correct files, and the service port is changed to the one of the MockService.
The root page of the MockEngine displays a list of running MockServices:
Selecting a MockService displays the Interfaces mocked by it:
Selecting an interface displays the list of parts in the Interface:
... and selecting a part displays it in your browser:
The root WSDL part (displayed first in the list of parts) can be used to generate clients, etc..