views:

510

answers:

2

Is there a way to test a Web Service using VS2010 like it's used to test a web site?

For a web site I can create a set of WebTestRequest objects that emulate the loading and the parsing of a web page from the test and then, implementing the GetRequestEnumerator I can yield results to the load test so that the execution time and payload of any single page could be evaluated by the test runner and published in my test run reports.

I would like to do the same for a test using web service call so that each time I call the web service (there is some logic in calling it, like logging in, getting a security token and pass a proper formatted XML document to the web service method) I can yield the result to my test runner and evaluate it.

Is there a way to do it or do I need to implement a specific class inheriting from the WebTestItem abstract class?

Regards Massimo

A: 

This doesn't quite answer your question as it's a 3rd party tool, but SOAP UI is a great piece of (free) software for load testing web services, whether your own or someone else's. You can run individual requests, or do a bunch of different load tests.

We've used it for one service that uses credentials, so I'm sure it will work fine for your scenario.

ScottE
I know soap UI and we've used extensively, problem is that the same web site uses load from both Web applications and web service call. Using VS2010 I was hoping to collect both data at once instead of having to correlate by hand web test made with selenium and web service test made with soapui
massimogentilini
Interesting. We actually deal with something quite similar - 3rd party web service call and local application data being joined together. Let me know what you come up with!
ScottE
You can test Web Services using the Web Performance Tests in Visual Studio 2010 Ultimate.
Enrico Campidoglio
+1  A: 

Yes, it is possible to test Web Services using Web Performance Tests in Visual Studio 2010 Ultimate.

Here's a couple of useful links:

As a starting point, you can use a web proxy tool like Fiddler to intercept the HTTP requests made to the Web Services, copy the contents of the SOAP envelopes in the Web Performance Tests and then tweak them accordingly based on the test scenario you want to simulate.

Enrico Campidoglio