首页 > 代码库 > lr http请求访问webservice—soap_request

lr http请求访问webservice—soap_request

Action()
    {
         web_add_header("SOAPAction", "http://WebXml.com.cn/getWeather");
         soap_request("StepName=Sample Soap Request",
                      "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>",
                      LAST);

待续!!!!!!!


     /*
    lr_xml_get_values("XML={Response_Xml}",
              "ValueParam=Author_Name",
              "Query=/books/book/author",
              LAST);
         lr_output_message(lr_eval_string("Author is = {Author_Name}"));
         if(strcmp(lr_eval_string("{Author_Name}"),"John Smith") == 0)
         {
            lr_end_transaction("AUTHOR", LR_PASS);
         }
         else
         {
            lr_end_transaction("AUTHOR", LR_FAIL);
         }
     */
         return 0;
    }

lr http请求访问webservice—soap_request