函数介绍

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. html 标签 链接

    <a href="http://www.baidu.com">百度</a> <a href="#here">here< ...

  2. Vue 组件 非父子组件通信

    有时候两个组件也需要通信(非父子关系),在简单的场景下,可以使用一个空的vue实例作为中央事件总线: var bus = new Vue(); //触发组件a中的事件 bus.$emit('id-se ...

  3. openWRT自学---初始化过程和主要脚本的分析

    参考文档: http://wiki.openwrt.org/doc/techref/process.boot http://blog.csdn.net/jk110333/article/details ...

  4. MySQL 5.7以上 root用户默认密码问题

    废话少说一句话系列: CentOS系统用yum安装MySQL的朋友,请使用 grep "temporary password" /var/log/mysqld.log 命令,返回结 ...

  5. Style Lessons in Clarity and Grace (11th Edition)中文翻译

    Joseph, Williams. "Style: Lessons in Clarity and Grace." Pearson Schweiz Ag (2014). 下载地址:h ...

  6. android Service 保持不被杀死

    Android开发的过程中,每次调用startService(Intent)的时候,都会调用该Service对象的onStartCommand(Intent,int,int)方法,然后在onStart ...

  7. c++ 继承,组合

    .什么是继承 A继承B,说明A是B的一种,并且B的所有行为对A都有意义 eg:A=WOMAN B=HUMAN A=鸵鸟 B=鸟 (不行),因为鸟会飞,但是鸵鸟不会. .什么是组合 若在逻辑上A是B的“ ...

  8. 【BZOJ2226】[Spoj 5971] LCMSum 莫比乌斯反演(欧拉函数?)

    [BZOJ2226][Spoj 5971] LCMSum Description Given n, calculate the sum LCM(1,n) + LCM(2,n) + .. + LCM(n ...

  9. C#中enum的总结(转载)

    1.关于enum的定义 enum Fabric { Cotton = 1, Silk = 2, Wool = 4, Rayon = 8, Other = 128 } 2.符号名和常数值的互相转换   ...

  10. DropdownList异步刷新GridView数据

    前台代码: <div style=" clear:both; width:800px; text-align:center; margin-left:auto; margin-righ ...