性能基础学习6-WebService(SOAP协议)实战

导入的WSDL:http://www.webxml.com.cn/webservices/weatherwebservice.asmx?wsdl

演示接口:getSupportCity 

查询本天气预报Web Services支持的国内外城市或地区信息

输入参数:byProvinceName = 指定的洲或国内的省份,若为ALL或空则表示返回全部城市;返回数据:一个一维字符串数组 String(),结构为:城市名称(城市代码)。

Action()
{

web_service_call( "StepName=getSupportCity_101",
"SOAPMethod=WeatherWebService|WeatherWebServiceSoap|getSupportCity",
"ResponseParam=response",
"Service=WeatherWebService",
"ExpectedResponse=SoapResult",
"Snapshot=t1567045711.inf",
BEGIN_ARGUMENTS,
"byProvinceName=",
END_ARGUMENTS,
BEGIN_RESULT,
"getSupportCityResult=Param_getSupportCityResult",
END_RESULT,
LAST);

//xml形式 关联 结果 标准格式:<string>上海 (58367)</string>
lr_xml_extract("XML={response}",
"FastQuery=/Envelope/Body/getSupportCityResponse/getSupportCityResult/string[2]",
"XMLFragmentParam=ParamXml_string",
LAST);

//values形式 关联 结果 值:上海 (58367)
lr_xml_get_values("XML={response}",
"FastQuery=/Envelope/Body/getSupportCityResponse/getSupportCityResult/string[2]",
"ValueParam=ParamValue_string",
LAST);
//设置检查点
lr_xml_find("XML={response}",
"FastQuery=/Envelope/Body/getSupportCityResponse/getSupportCityResult/string",
"Value=北京 (54511)",
LAST);


return 0;
}

 

猜你喜欢

转载自www.cnblogs.com/huanghousong/p/11428576.html