How to test WCF + ASMX web services (web performance test + load test)

For how to test an ASMX webservice using Web Performance Testing, please check this, is the best example so far:

How to test a WCF web service using web performance test in VS2010:

First create a simple WCF webservice. Here we focus on the most important steps:

  • Create a simple WCF webservice (just the one VS2010 creates by default):
    click File->New Web Site -> WCF service and keep the original name, ex: WCFService1. It will be automatically created the webservice Service.svc in Solution Explorer. Don’t forget to build the application šŸ™‚
  • Register the webservice in IISManager as a new webservice: on Computer Management click right-> Manage ->IIS Manager and in Sites->”Default Web Site” click right and select “Add Application”, pointing it to the folder where our project WCFService1 was created. My case: C:\Users\Zora\Documents\Visual Studio 2010\WebSites\WCFService1
  • Give rights to IIS on this folder
  • Test the website by opening the link: http://localhost/WCFService1/Service.svc

Create the Web performance test:

Add a load test to stress the website using 250 asynchronous calls (because that’s the maximum VS2010 allows without an additional license):

  • Right click the TestProject1 and choose Add -> Load Test and you’ll be redirected to a nice & complicated wizard where first you press Next before you’re actually reading the whole content…
  • At the next window you can leave the scenario name “Scenario1” (i’m so full of imagination) but enable “Do not use think times” if you really wanna stress it šŸ˜‰ and press Next.
  • Use “constant load” of 250 users (we’re really aiming to complete exhaustion of the poor thing), then choose “Based on the number of virtual users” and next!.. you’ll have to click “Add” in the screen “Add a test to the load test” and select the web performance test(WebTest1) from the previous example.Ā Ā  (Here you can use any test method you already defined in another test class for instance. I defined once a test method in a class which was calling my web service and i used it here for the load test using 250 asynchronous calls).
  • Click next until you get to the last section of the wizard, “Run settings”. Here you can choose the number of iterations or the duration in minutes of the load test. 5 mins of 250 asynch is enough. The test step is minimum 5 secs, so that’s it, let’s run the test. Click on the green arrow right above the LoadTest1 and wait for the results. There should be no errors, but might be some thresholds warnings..

7 Comments on “How to test WCF + ASMX web services (web performance test + load test)”

  1. vijaivel says:

    I have done the same with u r post reference, when i am running the test i am getting 400 bad request error….
    any solution Please let me know….

  2. sskin says:

    I have tried the same. But, getting 415 response.
    Is there a way to add WS Addressing to the web performance test webservice request?
    Thanks in advance.

  3. Hi there, i read your blog occasionally and i own a similar one and i was just wondering if
    you get a lot of spam comments? If so how do you prevent it, any plugin
    or anything you can suggest? I get so much lately it’s driving me crazy so any assistance is very much appreciated.

    • Hi, I visit the blog so little that I didn’t even wonder about spam comments. I’m not so serious on writing the blogs on an up-to-date basis, so I didn’t really care… Sorry I have no suggestions šŸ˜¦ There is an “Anti-spam” plugin from wordpress, try it, maybe it will work.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s