I have written one way to do the XML content check for web service call:
http://joychester.blogspot.com/2009/02/content-check-for-webservicecalls.html
Here is another simple way to do this in Loadrunner if you find hard to write a Query(Xpath) in lr_xml_find:
Char Position;
......
lr_start_transaction("web service transaction");
web_service_call( "StepName=echo_101",
"SOAPMethod=MyService.MyServiceSOAP12port0.echo",
"ResponseParam=response",
"Service=MyService",
"Snapshot=t1156241380.inf",
BEGIN_ARGUMENTS,
"xml:part1=*******",
END_ARGUMENTS,
BEGIN_RESULT,
"part1/EchoOutput=Param_EchoOutput2",
END_RESULT,
LAST);
//want to match if the response data include Success Key word
Position= (char *)strstr(lr_eval_string("{response}"), "Success");
if (Position!=NULL) {
lr_end_transaction("web service transaction", LR_PASS);
}
else {
lr_output_message("web service call error occured!Help!:)"
}
Monday, March 23, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment