函数介绍

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. spring boot中 使用http请求

    因为项目需求,需要两个系统之间进行通信,经过一番调研,决定使用http请求. 服务端没有什么好说的,本来就是使用web 页面进行访问的,所以spring boot启动后,controller层的接口就 ...

  2. mysql的两个备份语句

    适合多引擎混合(例如:myisam与innodb混合)的备份命令如下: mysqldump -A -R --triggers --master-data=2 --single-transaction  ...

  3. iOS --发送手机验证码收不到手机验证码

    方法一:使用受信任设备上显示的验证码. 如果您的受信任设备是iOS 9 及以上系统时,则验证码将自动显示在受信任设备上.此时你信任的设备上会弹出你在某地登录ID位置的小地图,有一个选择允许与不允许登录 ...

  4. faceswap

    https://github.com/deepfakes/faceswap https://anonfile.com/p7w3m0d5be

  5. urllib -- ProxyHandler处理器(代理设置)

    import urllib.requestimport randomimport ssl proxy_list = [ {"https" : "196.61.27.58: ...

  6. IndiaHacks 2016 - Online Edition (CF) . D

    这题思路很简单,二分m,求最大流是否大于等于x. 但是比赛过程中大部分的代码都被hack了... 精度问题,和流量可能超int 关于精度问题,这题真是提醒的到位,如果是先用二分将精度控制在10^-8左 ...

  7. Java+selenium自动化测试基础

    Java+selenium maven配置 maven的配置,但还需要建立maven的本地库,修改apach-maven的setting.xml http://www.cnblogs.com/haoa ...

  8. 【转】在服务器上排除问题的头五分钟&常用命令

    转自:https://blog.csdn.net/l821133235/article/details/80103106(在服务器上排除问题的头五分钟) 遇到服务器故障,问题出现的原因很少可以一下就想 ...

  9. Magic Cast Method in Java Magic Trick In Java

    https://www.atlassian.com/blog/archives/magic_trick_in_java https://www.gamlor.info/wordpress/2010/1 ...

  10. margin 依附与可见的内容,不能为margin而写margin

    margin  依附于可见的内容,不能为margin而写margin <!DOCTYPE html><html><head><style> p{marg ...