Action() { web_add_header("SOAPAction", "http://WebXml.com.cn/getWeather"); soap_request("StepName=Sample Soap Request", "ExpectedResponse=AnySoap", "URL=http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx", "SOAPEnvelope= " "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"http://WebXml.com.cn/\">\n" " <soapenv:Header/>\n" " <soapenv:Body>\n" " <web:getWeather>\n" " <!--Optional:-->\n" " <web:theCityCode>792</web:theCityCode>\n" " <!--Optional:-->\n" " <web:theUserID></web:theUserID>\n" " </web:getWeather>\n" " </soapenv:Body>\n" "</soapenv:Envelope>", "ResponseParam=Response", LAST); lr_convert_string_encoding(lr_eval_string("{Response}"),LR_ENC_UTF8,LR_ENC_SYSTEM_LOCALE,"ResponseUTF8"); lr_output_message("Response is : %s",lr_eval_string("{ResponseUTF8}")); lr_xml_get_values("XML={Response}", "ValueParam=getResult", "Query=/soap:Envelope/soap:Body/getWeatherResponse/getWeatherResult/string", LAST); lr_output_message(lr_eval_string("weatherResult = {getResult}")); return 0; }
转载于:https://www.cnblogs.com/stay-sober/p/4172372.html
