2

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

2

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.

3
  • 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
    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)). 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
    May 12, 2011 at 12:20

Your Answer

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

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