zoukankan      html  css  js  c++  java
  • Loadrunner test web service which need username and password

    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;
    }

  • 相关阅读:
    异常机制和File类
    《JAVA程序设计》_第五周学习总结
    20165214 第五周学习任务
    20165214 第四周学习任务
    20165214 第三周学习任务
    20165214 预备作业3 Linux安装及学习
    20165313 预备作业3 Linux安装及学习
    学习基础和C语言基础调查
    20165313 我期望的师生关系
    int *ptr=(int *)(&a+1)
  • 原文地址:https://www.cnblogs.com/ellie-test/p/3942102.html
Copyright © 2011-2022 走看看