zoukankan      html  css  js  c++  java
  • LR接口测试---webservices

    //==================================================================================

     1 /*
     2 //事务开始
     3 lr_start_transaction("webservice");
     4 
     5 
     6 web_service_call( "StepName=getOrderInfoById_102",
     7 "SOAPMethod=OrderServiceService|OrderServicePort|getOrderInfoById",
     8 "ResponseParam=response",
     9 "Service=OrderServiceService",
    10 "ExpectedResponse=SoapResult",
    11 "Snapshot=t1459673036.inf",
    12 BEGIN_ARGUMENTS,
    13 "arg0=111",
    14 "arg1=222",
    15 END_ARGUMENTS,
    16 BEGIN_RESULT,
    17 "return=Param_return",
    18 END_RESULT,
    19 LAST);
    20 
    21 lr_xml_get_values("XML={getOrderInfoById_102_Response}",
    22 "ValueParam=OutputParam", //参数的名称
    23 "Query=/getOrderInfoById/return",
    24 LAST );
    25 if(strcmp(lr_eval_string ("{OutputParam}"),"orderId:222") ==0 ){
    26 
    27 lr_end_transaction("webservice", LR_PASS);
    28 
    29 
    30 }else{
    31 
    32 lr_end_transaction("webservice", LR_FAIL);
    33 
    34 }
    35 
    36 */

    //=====================================另一种方法=======================================

     1 int find_cnt;
     2 
     3 
     4 lr_start_transaction("webservice");
     5 
     6 web_service_call( "StepName=getOrderInfoById_102",
     7 "SOAPMethod=OrderServiceService|OrderServicePort|getOrderInfoById",
     8 "ResponseParam=response",
     9 "Service=OrderServiceService",
    10 "ExpectedResponse=SoapResult",
    11 "Snapshot=t1459673036.inf",
    12 BEGIN_ARGUMENTS,
    13 "arg0=111",
    14 "arg1=222",
    15 END_ARGUMENTS,
    16 BEGIN_RESULT,
    17 "return=Param_return",
    18 END_RESULT,
    19 LAST);
    20 
    21 find_cnt = lr_xml_find("XML={getOrderInfoById_102_Response}",
    22 
    23 "Value=orderId:222",
    24 
    25 "Query=/getOrderInfoById/return",
    26 
    27 LAST );
    28 
    29 if (find_cnt >0) {
    30 
    31 lr_end_transaction("webservice", LR_PASS);
    32 
    33 
    34 }else{
    35 
    36 lr_end_transaction("webservice", LR_FAIL);
    37 
    38 }
    39 
    40  
  • 相关阅读:
    查看 lib 库信息
    评委打分(C++ 容器综合练习)
    二阶段12.16
    对搜狗输入法的使用心得
    二阶段12.14
    二阶段12.13
    二阶段12.12
    典型用户描述
    水王(课堂练习)
    一阶段11.21
  • 原文地址:https://www.cnblogs.com/hanxiaobei/p/5297512.html
Copyright © 2011-2022 走看看