我这里添加的是网上公用的天气预报webservice,地址是:http://www.webxml.com.cn/WebServices/WeatherWebService.asmx
1)引入webservice,注意wsdl后缀
2)给入参填值
3)给返回值指定存储到的变量中
详细脚本如下:
lr_start_transaction("weather_webservice");
web_service_call( "StepName=getSupportCity_101",
"SOAPMethod=WeatherWebService|WeatherWebServiceSoap|getSupportCity",
"ResponseParam=response",
"Service=WeatherWebService",
"ExpectedResponse=SoapResult",
"Snapshot=t1385451471.inf",
BEGIN_ARGUMENTS,
"byProvinceName=江苏",
END_ARGUMENTS,
BEGIN_RESULT,
"getSupportCityResult=result",
END_RESULT,
LAST);
lr_output_message(lr_eval_string("{result}"));
if(strstr(lr_eval_string("{result}"),"镇江")>0){
lr_end_transaction("weather_webservice",LR_PASS);
}else{
lr_end_transaction("weather_webservice",LR_FAIL);
}
return 0;