函数介绍

soap_request

函数执行一个SOAP请求

函数原型

int soap_request( const char *StepName, ExpectedResponse, URL, , [Attachments,] LAST);

参数说明:

StepName: 函数名称

ExpectedResponse:可接受的响应类型

1)ExpectedResponse=SoapResult: 接受SOAP输出响应,且出现SOAP错误响应则标记失败(Accept SOAP output responses and fail on SOAP faults)

2)ExpectedResponse=SoapFault: 接受SOPA错误响应,且SOAP正常输出响应则标记失败(Accept SOAP faults and fail on SOAP output responses)

3)ExpectedResponse=AnySoap: 接受SOAP输出和SOAP错误响应(Accept both SOAP output and SOAP fault responses.)

URL: WebService需要加载的url地址

XMLEnvelope

用于必备元素列表,使用以下字符串格式:

"Element=value"

SOAPEnvelope: 发送给服务器是XML数据包

Snapshot: 包含函数快照的.inf文件名

ResponseParam:  存储服务器响应的输出参数。

Attachments: 需要发送、接收的附件(可选参数) 详情查阅官方文档 Attachment Specifications

LAST: 表名Specifications  list结束的标记

Web Service接口测试

协议选择

脚本

Action()
{

soap_request("StepName=soap_request",

"ExpectedResponse=SoapResult",

"SOAPEnvelope="

"<soapenv:Envelope xmlns:\"http://schemas.xmlsoap.xml.org/soap/envelope/"

"\"xmlns:web=\"http://WebXml.com.cn/\">"

"<soapenv:Header/>"

"<soapenv:Body>"

"<web:getSupportProvince/>"

"</soapenv:Body>"

"</soapenv:Envelope>",

"URL=http://webxml.com.cn/WebServices/WeatherWebService.asmx?",

"Snapshot=soap_request.inf",

"ResponseParam=response",

LAST);

return 0;
}

运行结果:

对比SoapUI测试结果

Loadrunder脚本篇——webservice接口测试(一)的更多相关文章

  1. Loadrunder脚本篇——webservice接口测试(二)

    1.选择协议--Web Service,如下图 2.导入服务 入口1:点击Manage Services ->弹出窗中选择“Import” ->弹出窗中选择“URL”,填写wsdl地址,导 ...

  2. Loadrunder脚本篇——web_custom_request做接口测试

    一.POST + JSON格式参数 例: web_custom_request("create", "URL=http://xxx.xxx.x.xx:1600/ditui ...

  3. Loadrunder脚本篇——关联数组(参数数组)

    导言 前面说过可以用关联取出服务器相关的一些动态变化的信息,前面也提过web_reg_save_param中可以设置ord=all,代表从服务器中取出的是一个数组,它试用的场景是当我访问一个发帖网站, ...

  4. Loadrunder脚本篇——web_submit_data实现提交post请求

    概述 web_link()和web_url()函数都是页面访问型函数,实现HTTP请求中的GET方法,如果需要实现POST方法,可使用web_submit_form或web_submit_data() ...

  5. Loadrunder脚本篇——web_custom_request函数介绍

    c语言版本: int web_custom_request(const char *RequestName, , [EXTRARES, ,] LAST ); 参数说明: RequestName     ...

  6. loadrunder脚本篇——执行操作系统命令

    思路: 用loadrunner system()函数 函数原型: int system( const char *string ); 示例一:在指定目录下创建指定文件 Action() { char ...

  7. Loadrunder脚本篇——文件下载

    下载简介 对 HTTP协议来说,无论是下载文件或者请求页面,对客户端来说,都只是发出一个GET请求,并不会记录点击后的“保存”.“另存为操作”. 如下,点击页面中tar.gz压缩包,用工具可以清楚的看 ...

  8. loadrunder脚本篇——文件读写操作

     函数说明 函数原型: size_t fwrite( const void *buffer, size_t size, size_t count, FILE *file_pointer ); 参数说明 ...

  9. Loadrunder脚本篇——Run-time Settings之Browser Enmulation

    浏览器模拟 所有Internet Vuser Header包含一个标识将被模拟的浏览器类型(或无线工具包)的User Agent header.例如User-Agent: Mozilla/3.01Go ...

随机推荐

  1. 喜闻乐见的const int *p、int* const p、const int* const p

    不废话直接代码示例: void f(const int *p) { ; *p = ; // error p = &b; // fine } void f(int* const p) { ; * ...

  2. JPA动态查询封装

    一.定义一个查询条件容器 /** * 定义一个查询条件容器 * * @param <T> */ public class Criteria<T> implements Spec ...

  3. linux前后台任务切换管理

    liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ vi 33chartcreate-line.php & [] liuyuan@ebui ...

  4. js模板引擎artTemplate快速上手

    腾讯的artTemplate 1,编写模板 (采用script标签并带有属性id和type="text/html") <script id="test" ...

  5. iframe定位获取

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  6. javascript对象定义

    转载自:http://blog.sina.com.cn/s/blog_75a8cfac0100pif0.html javascript定义对象写法 javascript定义对象的几种简单方法 1.构造 ...

  7. shell bash使用,包括判断文件或文件夹是否存在举例

    Linux shell编程——if条件判断 if [ condition ] ;then //一定要注意[] 與裡面的內容要有空格隔开 例如 if [(空格)${a} -eq 3(空格)]; then ...

  8. vfptr(2)

    //i_vptr struct i_vptr { ; }; //vptr.h #include "i_vptr.h" #include <iostream> class ...

  9. 2318: Spoj4060 game with probability Problem

    2318: Spoj4060 game with probability Problem Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 356  Sol ...

  10. cocos2d-x设计模式发掘之一:单例模式

       作者: firedragonpzy  原地址:http://www.firedragonpzy.com.cn/index.php/archives/1781 本系列文章我将和大家一起来发掘coc ...