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

Loadrunner test web service which need username and password

时间:2014-08-28 18:05:25      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:style   http   os   io   ar   2014   art   cti   amp   

Action()
{

 char  * position;
 char * str;

 int  offset;
 char * search_str = "ERROR";

   // web_set_sockets_option("INITIAL_BASIC_AUTH","1");
   
    web_set_user("21652362","zxcv!123","g1u2367.austin.hp.com:8020");

 

 lr_start_transaction("MPO_LP");

 soap_request("StepName=SOAP Request",          
  //"URL=http://g1u2367.austin.hp.com:8020/sap/bc/srt/rfc/sap/ZMPO_LP?sap-client=445",          
  "URL=http://g1u2367.austin.hp.com:8020/sap/bc/srt/rfc/sap/ZMPO_LP?sap-client=445&wsdl=1.1",
  "SOAPEnvelope="
  "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:sap-com:document:sap:soap:functions:mc-style\">"
   "<soapenv:Header></soapenv:Header>"
   "<soapenv:Body>"
    "<urn:Z9pMpoPriceRfc>"
     "<PriceRecord>"
      "<item>"
       "<Product>{Product}</Product>"
       "<ProdOption></ProdOption>"
       "<PriceGeo>{PriceGeo}</PriceGeo>"
       "<Currency>USD</Currency>"
       "<PriceListType></PriceListType>"
       "<Incoterm>DDP</Incoterm>"
       "<EndDate>2014-12-31</EndDate>"
       "<StartQuantity>1</StartQuantity>"
       "<StartDate>2014-08-30</StartDate>"
       "<Amount>50</Amount>"
       "<Uom>EA</Uom>"
       "<ScaleFlag></ScaleFlag>"
       "<DeleteFlag></DeleteFlag>"
       "<PrsPubStPk>{PrsPubStPk}</PrsPubStPk>"
      "</item>"
     "</PriceRecord>"
    "</urn:Z9pMpoPriceRfc>"
   "</soapenv:Body>"
  "</soapenv:Envelope>",          
  "SOAPAction=SendbyMPO",          
  "ResponseParam=response",          
  "Snapshot=t1409203819.inf",            
  LAST);

 


 str= lr_eval_string("{response}");

 position = (char *)strstr(str, search_str);

 if (position == NULL) {
  lr_end_transaction("MPO_LP", LR_PASS);
 }
 else
  lr_end_transaction("MPO_LP", LR_FAIL);


    lr_message ("*****************");

 lr_message ("message returned as: %s", lr_eval_string("{response}"));

 lr_message ("*****************");

 return 0;
}

 

Loadrunner test web service which need username and password

标签:style   http   os   io   ar   2014   art   cti   amp   

原文地址:http://www.cnblogs.com/ellie-test/p/3942102.html

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