Loadrunner 之 webservice---Add Service Call

Webservice地址http://www.webxml.com.cn/WebServices/WeatherWebService.asmx
在loadrunner中选择webservice协议
1.选择Manage Service 中import地址为http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?WSDL
2.Add Service Call 选择调用接口,输入参数,进行参数化
3.打开Vuser--Run-Time Settings--Log--Extended log--Parameter substiution,运行
4.取xml的返回节点 lr_xml_get_values("XML=XXX",                   
"Query=/ XXX/ XXX/ XXX ",
                   "ValueParam=XXX",
"SelectAll=yes",
                   LAST);
XML为要查找的xml内容
Query为要查找的层节点
ValueParam为保存的变量名

Action()
{
web_service_call( "StepName=getSupportCity_101",
"SOAPMethod=WeatherWebService|WeatherWebServiceSoap|getSupportCity",
"ResponseParam=response",
"Service=WeatherWebService",
"ExpectedResponse=SoapResult",
"Snapshot=t1338952507.inf",
BEGIN_ARGUMENTS,
"byProvinceName={Province}",
END_ARGUMENTS,
BEGIN_RESULT,
END_RESULT,
LAST);
lr_xml_get_values("XML={response}",                   "Query=/Envelope/Body/getSupportCityResponse/getSupportCityResult/string",
                  "ValueParam=ParamValue_string",
  "SelectAll=yes",
                  LAST);



return 0;
}

你可能感兴趣的:(webservice)