WCF Load Test with Visual Studio or any other free tools - wcf

We have a WCF web service and I would like to perform a load test. Could anyone please confirm if this is possible via Visual Studio 2010 or any other free tools?
Thank you

I have done a decent amount of this over the last five years using mstest and jetbrains dottrace.
What you need to do is write an integration test (a unit test that makes a call to your service) and then reference that in a load test. I then get dottrace to profile IIS and then rune the load test.

A free tool is available from CodePlex to load test WCF. To quote the project description:
This tool takes a WCF trace file and a WCF client proxy, or a WCF interface contract, and generates a C# unit test that replays the same sequence of calls found in the trace file. The unit test can then be used to load-test the target

You can with VS as long as you own the ultimate edition.

Related

WCF project will not be hosted when unit test runs

I created a WCF project using the IIS model. I then created unit tests which reference services from that project. Now when I start the unit test, the service is not hosted and thus I get EndpointNotFoundExceptions. When I simply hit F5 everything works fine and the IIS Express comes up in tray.
I checked the option "Always start when debugging" in the property-pane of the service-project and it is set to true.
A Unit Test is a unit test. If you need another process for it (namely some IIS or other web server) it's no longer a closed unit. If you want to test your service when it's hosted, I'd suggest you host it in your test yourself. Check self-hosting services. Then you have control about what class is hosted when and where. For example, you may want a different URL for your unit test and you may want to inject a different data layer so your tests don't need anything outside your unit, like a database.
You are not doing unit testing, and you are actually doing integration testing, since your test suit has no direct knowledge/binding of the service codes and it is just a client program of the service.
Both unit testing and integration testing contribute to good QA. Generally you should create unit testing which directly test the service codes through in process binding interfaces, and make sure it has comprehensive code coverage.
Then create integration testing using MS Test, NUnit or xUnit as test harness, in order to test some run time behaviors of the service.
What puzzle you is that how to make the test suit in the same VS sln run while the service should be running in debug mode. There could be a few solutions:
Build the test suit using Nunit or xUnit, then run the test suit outside VS IDE which is running the service in Debug mode. Actually MS Test could support as well, but only in command line mode.
Host the service in IIS, and you have a batch files to copy assemblies and web.config to there upon every update. Then attach the service codes with respective w3wp.exe instance.
If you just want to test rather than debug, there could be another solution: Use IIS Express. You use either C# codes or batch file to launch IIS Express with the service during tearing up, and close IIS Express when tearing down.

Launch/Deploy latest version WCF service before running unit tests in vs2012

I want VS to deploy the latest version of the WCF every time I run my tests.
Currently I have to deploy manually, or run the WCF Service, for it to be deployed.
I'm looking for a functionality similar to starting multiple projects when debugging.
Maybe to specify the behaviour I am missing right now. I can not set breakpoints inside the webservice, as it's not run in debug-mode.
#codespike Using standard unit testing in VS2012
#codespike With Deploy I mean "copy latest version to local IIS, so it can be respond
to calls over the web.
#mayo Yes! that is a brilliant suggestion. Bypassing the Coding and Decoding (webtransport) phase, and go straight to the classes that manipulate the data.

Unit Testing Web Services using .net

I have wcf .net client to a webservice. I am trying to ensure that the connection to this web service is solid and that the web-service itself is sturdy and can stand up and take a pounding. I was hoping to hit it with 50 different asynchronous calls to ensure that it is working well. Is there a way that I can use the .net framework to make multiple asynchronous calls to the webservice?
If you're using VS 2012 you can use the built-in load testing
You can also use free tools such as LoadUI
Visual Studio 2010 (Test edition or Ultimate edition) has excellent support for performance and load testing (with plenty of extensibility points to meet your needs). Check the following blog for a series of links related to load and web performance testing:
http://blogs.msdn.com/b/edglas/archive/2007/12/17/content-index-for-web-tests-and-load-tests.aspx
A good approach is to use fiddler to record traffic between application and service and then export this into a web performance test.

How to load test REST WCF service?

How can i load test REST WCF service?
Is it possible with Web performance testing and Load testing in Visual Studio 2010 Ultimate.
Please help. Thanx in advance.
This knowledgebase article has information on the tools available for stress testing web apps from Microsoft. I've used the Web Capacity Analysis Tool mentioned there in the past.
You can also look at the fiddler plugin stresstimulus. I've used fiddler for non load testing, but I have not used the stresstimulus plugin.
Disclosure: I work for StresStimulus maker.
In case you need to test with more than 250 users allowed by VS 2010 Ultimate, you can still record HTTP sessions in Fiddler, as described by #Nat, and then use StresStimulus for load testing in Fiddler. StresStimulus is not nearly as complete as VS 2010 Ultimate, but it’s free and you can check if it’s sufficient for your case. You can parameterize requests using .CSV files and load test with up to 1500 virtual users per client.
At the end of the day, a WCF web service still relies on good old http calls.
You are not really going to be able to record the webtest the same as for a webpage, but Fiddler will allow you to record the http calls made, so fire fiddler and then use the interface for your service to record some actions.
You can then save the fiddler http calls as a webtest for Visual Studio.
I personally would turn the test into a coded test so that items in the Webservice can be parameterised nicely, but it depends on what you need to do. Once a test is recorded, you can easily change the base url to point it to pre-production test environments or whatever is required.
Visual Studio 2010 Ultimate is a really nice tool for load testing and with 250 virtual users available for load testing, you can simulate a lot of actual users with it.

creating a WCF client proxy with 3 solution windows open

My WCF service library, the console host for the service, and the client are all in separate Visual Studio solutions. Does this choice of organization impose a problem? I cannot seem to create the client proxy by using the Add Service Reference and Discovery features.
When I run the console hosted WCF service, then change focus to the Visual Studio solution for developing a client, invoke "add service reference" and "discover" it says "no services found in the solution". Do I have to develop the client code inside the same Visual Studio solution as I have developed the host code? That would seem unreasonable.
Having several projects for your WCF solution is a great idea - definitely stick with that!
But you cannot run the WCF host application from within Visual Studio and then use Visual Studio to add the service reference, too, at the same time....
So what you need to do is run the service host application from outside Visual Studio (find the directory, double-click on the EXE to spin up the host) and then you can add the client service reference inside Visual Studio.
In such cases I usually use a single solution file containing all projects across all subsystems + separate solution files for individual subsystems. This allows me to develop the system as a whole, and, at the same time, build individual subsystems separately. This way you can overcome any “editing-time experience” shortcomings, while preserving good separation and independence of subsystems.
Solutions are meant to have multiple projects in them. They are meant to be the level of organization that contains all of the projects you are working on at a time.
No, it's not unreasonable to put all of those related projects into a single solution.