S h o r t S t o r i e s

// Tales from software development

Web Service Mocking

leave a comment »

I’ve just finished writing an interface for our medical information system that calls a customer’s web service for patient data. The web service isn’t yet available to use but, as it’s fairly simple, I created some test stubs that could be used to simulate the calls to the web service although they were actually in-process calls rather than a mocked web service.

Having finished the initial development I started testing and realised that, while useful during development,  my test stubs didn’t provide a useful testing environment. I considered writing a simple web service to mimic the customer’s but after a quick web search for web service mocking tools decided to give soapUI a try, not least because it’s available as a free open-source version.

I was sceptical of one reviewer’s claim that a mocked web service could be configured and running within a few minutes but was surprised to find that this is true. All I did was run soapUI, load the WSDL for the customer’s web service, and start the mock service.

To have the mock service return data you need to specify a response for each method called but soapUI provides an XML template for the response that makes it quick and easy to do this. There are several options to vary the response according to the method’s arguments.

Highly recommended.


Written by Sea Monkey

December 14, 2011 at 8:00 pm

Posted in Development

Tagged with

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: