How to test a WCF Webservice with JMeter?

前端 未结 2 971
失恋的感觉
失恋的感觉 2021-02-09 04:36

I have a WCF Webservice hosted on IIS which exposes a single method that takes three integer parameters. I have a simple, console based client which can call this method.

相关标签:
2条回答
  • 2021-02-09 05:11

    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.

    0 讨论(0)
  • 2021-02-09 05:15

    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! :-)

    0 讨论(0)
提交回复
热议问题