Web Services performance using LoadRunner HTTP Vuser script
January 24th, 2009
Small (basic) example howto test performance of Web Service using LoadRunner API.
Let say we have a web services that uses SOAP over HTTP. We want to check how fast we can send a request and receive a response. Because our service uses HTTP as a transport protocol, we are able to test it using simple HTTP Vuser script.
Here is the C code:
-
Action()
-
{
-
web_reg_save_param("Response","LB=", "RB=", LAST);
-
web_add_header("SOAPAction", "SampleMethod");
-
lr_start_transaction("REQ");
-
web_custom_request("Sample_Request","Method=POST",
-
"Mode=HTML",
-
"RecContentType=text/xml",
-
"EncType=text/xml; charset=utf-8",
-
"URL=http://example.com:1234/sample/",
-
"Body=<Envelope xmlns=\"http://example.com/sample\">\n"
-
" <Header/>\n"
-
" <Body>\n"
-
" <price><id>001</id></price>\n"
-
" </Body>\n"
-
"</Envelope>",
-
"LAST");
-
lr_end_transaction("REQ", LR_AUTO);
-
lr_output_message("Response is : %s\n", lr_eval_string("{Response}"));
-
return 0;
-
}
Have a fun…
