The following is an example of the LoadRunner script used to test WebServices:
Action ()
{
Web_service_call (
"Stepname = add_101 ",
"Soapmethod = service | servicesoap | Add ",
"Responseparam = response ",
"Service = service ",
"Expectedresponse = soapresult ",
"Snapshot = t1307948103.inf ",
Begin_arguments,
"A = 1 ",
"B = 2 ",
End_arguments,
Begin_result,
"Addresult = param_addresult ",
End_result,
Last );
// Lr_output_message (lr_eval_string ("{param_addresult }"));
// Lr_output_message (lr_eval_string ("{response }"));
Lr_xml_extract ("xml = {response }",
"Xmlfragmentparam = Result ",
"Query =/soap: envelope/soap: body/addresponse/addresult ",
Last );
Lr_output_message (lr_eval_string ("{result }"));
Return
0;
}
Note: The LoadRunner Method for Testing WebService is described in detail in the "Performance Test and tuning practices" video tutorial.