Service mocking | Virtualization in SoapUI
Channel: Specialize Automation
Date: 2017-07-18

Learn step by step how we perform mock service to design our test when no real environment is handy. Service mocking or service virtualization or service simulation is similar.

Service mocking in soapUI,
MockService in SoapUI,
How to do mock Services in soapUI,
How to perform MockService in soapUI,
Virtualization in soapUI,
Service Simulation in soapUI,
Why need MockService in API testing,


The SOAP Service Mocking functionality in SoapUI lets you create a standards compliant simulation of a WSDL based service just from its WSDL contract, which in soapUI is called a “MockService”. This can be run either directly from inside soapUI, with the included command-line runner, or even with a standard servlet container.
The usage scenarios for this are many:

1) Rapid Web Services Prototyping; generate a complete static mock implementation from a WSDL in seconds and add dynamic functionality using Groovy. This allows you to implement and test clients much faster than if you had needed to wait for the actual solution to get build.

2) Client testing or development; create mock implementations of desired operations and set up a number of alternative responses (including scripts, attachments and custom http headers). Clients can be developed against the MockService and tested without access to the live services. Responses can be cycled, randomized or selected with XPath expression from incoming request

3) Test Driven Development; Create Functional and Load Tests in soapUI against a MockService before or during the actual services being implemented

4) A MockService can simulate any number of WSDL contracts and the built in scripting functionality allows you to simulate basically any kind of desired behavior; fixed responses, random errors, dynamic results, etc. It is even possible to implement an entire service in soapUI and deploy it to a standard servlet container using the DeployAsWar functionality (although not recommended for production use).

A MockService complies with accepted WSDL, SOAP, or HTTP standards and a client should be able to use it just as if it was a real service.


SoapUI MockService: https://www.soapui.org/soap-mocking/working-with-mockservices.html
Linkedin: https://www.linkedin.com/in/aditya-kumar-roy-b3673368/
Facebook: https://www.facebook.com/SpecializeAutomation/