码迷,mamicode.com
首页 > Web开发 > 详细

lr http请求访问webservice——web_custom_request

时间:2014-12-18 20:16:16      阅读:268      评论:0      收藏:0      [点我收藏+]

标签:http   ar   io   os   sp   on   bs   cti   ad   

Action()
    {
       web_reg_save_param("Response","LB=", "RB=", LAST);
       web_add_header("SOAPAction","http://WebXml.com.cn/getWeather");
       web_custom_request("Sample_Request",
                          "Method=POST",
                          "Mode=HTML",
                          "RecContentType=text/xml",
                          "EncType=text/xml;charset=UTF-8",
                          "URL=http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx",
                          "Body="
                          "<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>",
                          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}"));
       return 0;
    }

lr http请求访问webservice——web_custom_request

标签:http   ar   io   os   sp   on   bs   cti   ad   

原文地址:http://www.cnblogs.com/stay-sober/p/4172367.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!