性能测试脚本之Webservice

WebService请求 
webservice请求的脚本建议通过可视化的方式添加 

1)引入webservice,注意wsdl后缀,点击manage service,然后import webservice wsdl文件

 

2.添加service,并参数化,生成脚本

3.保存response返回值

4.脚本实例

 

Action()

    
{

    web_service_call( "StepName=getSupportCity_101",
        "SOAPMethod=WeatherWebService|WeatherWebServiceSoap|getSupportCity",
        "ResponseParam=response",
        "Service=WeatherWebService",
        "ExpectedResponse=SoapResult",
        "Snapshot=t1487580556.inf",
        BEGIN_ARGUMENTS,
        "byProvinceName={city}",
        END_ARGUMENTS,
        BEGIN_RESULT,
        "getSupportCityResult=Param_getSupportCityResult",
        END_RESULT,
        LAST);

    

    web_service_call( "StepName=getSupportDataSet_102",
        "SOAPMethod=WeatherWebService|WeatherWebServiceSoap|getSupportDataSet",
        "ResponseParam=response",
        "Service=WeatherWebService",
        "ExpectedResponse=SoapResult",
        "Snapshot=t1487579089.inf",
        BEGIN_ARGUMENTS,
        END_ARGUMENTS,
        BEGIN_RESULT,
        END_RESULT,
        LAST);

    
    return 0;
}

 

posted @ 2017-02-20 16:53  TingJie  阅读(470)  评论(0编辑  收藏  举报