How to test a WCF Webservice with JMeter?

Disclaimer: I'm not a WSDL expert, so i can't tell you why the doc doesn't provide detail.

To generate the SOAP envelope for JMeter, I've used the free version of soapUI.

Steps

  1. Import WSDL into soap
  2. Create a default request for the method
  3. Set the request view to RAW, and copy into JMeter

This provides me all the information I need for jmeter, including parameters, user-agent, endpoint, etc.


Use JMeter's "HTTP Proxy Server" to record the WCF calls with your normal testclient, and then play them back later when testing. This is what I have experienced to be fastest, and gives the best test-cases (because you record them with your normal client, or test client of choice).

Set up JMeters HTTP Proxy Server as per instructions. Then, make sure the WCF (or any SOAP) client use that proxy. The important part of the WCF client configuation is (replace my ... with normal config):

<system.serviceModel>
    <bindings>
    ...
    <wsHttpBinding>
    <binding ...  proxyAddress="http://proxyServerName:8080" useDefaultWebProxy="false" ...>
    ...
        <security mode="None">
            <message establishSecurityContext="false"/>
            <transport clientCredentialType="None"/>
        </security>

proxyServerName is localhost, if the WCF client runs on the same machine as JMeter (normal when creating the test cases).

Also, I got an error message using HTTP Proxy, if I did not turn off security as shown above. The same security settings must also be at the WCF service server.

Happy testing! :-)