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

  • 相关阅读:
    【Ubuntu使用技巧】在Ubuntu下制作ISO镜像的方法
    【Linux调试技术1】初步基础
    【算法研究与实现】最小二乘法直线拟合
    【嵌入式学习】移植konquerorembed
    【Asterisk应用】利用Asterisk产生呼叫的脚本
    【LDAP学习】OpenLDAP学习笔记
    一个.NET通用JSON解析/构建类的实现(c#)
    .net泛型在序列化、反序列化JSON数据中的应用
    C#字符串数组排序
    c#中的Json的序列化和反序列化
  • 原文地址:https://www.cnblogs.com/ellie-test/p/3942102.html
Copyright © 2011-2022 走看看