How to check WCF web service using JMeter?

I have a WCF Webservice hosted in IIS that provides one method that accepts three integer parameters. I have a simple console client that can call this method.

int InsertNewOrder(short quantity, int custID, int productID); 

If my understanding is correct, I need to provide JMeter with a SOAP envelope with details of the method being called and the parameters that will be passed. I have seen many examples similar to below:

 <soapenv:Envelope xmlns:soapenv="schemas.xmlsoap.org/soap/envelope/">; <soapenv:Body> <ns2:InsertNewOrder xmlns:ns2="?????"> <ns2:Param1>${1}</ns2:Param1> <ns2:Param1>${1}</ns2:Param1> <ns2:Param1>${1}</ns2:Param1> </ns2:InsertNewOrder> </soapenv:Body> </soapenv:Envelope> 

However, looking at my WSDL document, I donโ€™t see where it refers to any of the parameters needed to go to the method. I also used Fiddler to check client soap messages for the service. Again, I do not see where it passes the parameters. As a result, I donโ€™t know how to create a simple SOAP envelope that I can use with JMeter to test this service.

Can someone tell me why the details of the method parameters are not indicated in the WSDL document, or explain how I can create the necessary SOAP envelope for use with JMeter?

I am coding in C # using VS 2010, JMeter 2.4, IIS v6, wsHttpBinding.

+6
c # soap web-services jmeter
source share
2 answers

Disclaimer: I am not a WSDL expert, so I cannot tell you why the document does not provide details.

To create a SOAP envelope for JMeter, I 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 gives me all the information I need for jmeter, including parameters, user agent, endpoint, etc.

+5
source share

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

Configure the JMeters HTTP proxy as per instructions . Then, make sure that the WCF (or any SOAP) client uses this proxy. An important part of setting up a WCF client is (replace my ... regular configuration):

 <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 is running on the same machine as JMeter (usually when creating test cases).

In addition, I received an error message using HTTP Proxy if I did not disable security, as shown above. The same security settings must also be on the WCF service server.

Happy testing !:-)

+2
source share

All Articles