I am developing a asp.net mvc site that depends deeply on a 3rd party web service.

I would like to know what is the best approach to develop this site since the web service is not ready yet and I can't wait it to be ready to start developing.

I am using Specflow and selenium to drive my development.

1 Answer 1


You can create mock response files of that web service and use them during development of your site. I assume that general structure of web service response is already established.

  • You mean, I can create interfaces representing these web services and implement them with mocks and after that just replace with the actual web services? Right? So, this means I would have to change the tests expectations also. Is this the best way?
    – thitemple
    Commented May 11, 2011 at 14:38
  • No-no, it's much simpler.Suppose a webservice returns an XML document. WIth an actual working webservice you would write something like doc = Nokogiri::XML(open('webservice.com?user="Adam Smith"')) (code in Ruby using XML parsing library Nokogiri), and then manipulate variable doc. With mock response files you should just use something like doc = Nokogiri::XML(File.new(AdamSmith.xml)). Commented May 11, 2011 at 15:28
  • But in that case we are assuming that I know exactly how the web service will return the data which is not the case. What I know is what it has to return and I have model classes, I will have to map the service data to my model. So I can't just replace an xml.
    – thitemple
    Commented May 12, 2011 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.