R – Automate test of web service communication

build-processcruisecontrol.netmsbuildnunitweb services

I have an application that sends messages to an external web service. I build and deploy this application using MSBuild and Cruisecontrol.NET. As CCNET build and deploys the app it also runs a set of test using NUnit. I'd now like to test the web service communication as well.

My idea is that as part of the build process a web service should be generated (based on the external web services WSDL) and deployed to the build servers local web server. All the web service should do is to receive the message and place it on the file system so I then can check it using ordinary NUnit for example. This would also make development easier as new developers would only have to run the build script and be up and running (not have to spend time to set up a connection to the third party service).

Are there any existing utilities out there that easily mock a web service based on a WSDL? Anyone done something similar using MSBuild?

Are there other ways of testing this scenario?

Best Answer

I just started looking into http://www.soapui.org/ and it seems like it will work nicely for testing web services.

Also, maybe look at adding an abstraction layer in your web service, each service call would directly call a testable method (outside of the web scope)? I just did this with a bigger project I'm working on, and it's testability is working nicely.