10 April 2007 - 1.7 |
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:
| ![]() |
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:
A status indicator with the possibility to turn on/off logging The list of MockOperations currently configured for this MockService. Right-clicking show the MockOperations available actions, double-clicking opens the MockOperation editor A Log of handled requests. Double-clicking a request displays the entire message exhange for that request as shown below: | ![]() |
When starting the MockService using the Run toolbar button, soapUI starts a local http server (if not already running for another MockService) and makes the MockService available on the configured port and path. 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: