Who better to tell you about a product than a developer who works on it every day? I don’t know either! So, in order to make sure soapUI users are benefiting from all of its functions, I asked Erik Yverling, a developer for soapUI and loadUI, for one tip that he would give to users. His answer, which you can watch below, highlights a “hidden gem” within the product.
MockService is the SOAP service mocking functionality of soapUI, which allows you to create simulation of a WSDL-based service right from its WSDL contract. This can be run directly from inside soapUI, with the included command-line runner, or with a standard servlet container.
Not only can a MockService simulate any number of WSDL contracts, it also allows you to simulate basically any kind of desired behavior: fixed responses, random errors, dynamic results, etc.
In fact, this feature is something that Erik found useful even before he started working with soapUI.
“When I was working as a Web developer on Eniro, the Nordic region’s largest search company, developing their new customer Web, we used soapUI to call the Web services we interacted with in an exploratory fashion,” he explained. “One day, one of my teammates told me with excitement that he found a way to mock Web services in soapUI instead of doing it in the source code. This showed us that soapUI could really increase the productivity for developers as well.”
And just in case you’re not sold on soapUI’s MockService feature yet, here are a few scenarios where MockService may be useful to you. You can also get a more detailed description of how to use this service by checking out soapUI’s MockService page.
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.
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.
Test Driven Development
Create functional and load tests in soapUI against a MockService before, or during, the actual services is implemented.