(Jmeter 三)JMETER+WEBSERVICE性能测试

预备知识:

http://www.cnblogs.com/yongfeng/archive/2013/01/30/2883146.html?utm_source=tuicool&utm_medium=referral

web service:在线应用服务,其他应用程序能通过网络协议和规定的数据格式(http、XML、soap)来访问。主要目的是跨平台的可互操作性。Web service可以理解为是一个应用程序,它向外界暴露出一个能够通过Web进行调用的API

XML:(Extensible Markup Language)扩展型可标记语言。描述数据的基本方式,是Soap的基础。

Soap:(Simple Object Access Protocol)简单对象存取协议。表示信息交换的协议,是XML Web Service 的通信协议。是一种轻量的、简单的、基于 XML 的协议,它被设计成在 WEB 上交换结构化的和固化的信息

WSDL:(Web Services Description Language) Web服务描述语言

UDDI (Universal Description, Discovery, and Integration) 通用描述、发现与集成,是一种独立于平台的、基于XML语言用于在互联网上描述商务的协议。

目的:

在http://www.webservicex.net/geoipservice.asmx?op=GetGeoIP页面输入IP地址获取改ip所属国家。

To start with an example, I was trying to test getgeoIPservicefrom below WSDL.
http://www.webservicex.net/geoipservice.asmx?wsdl


原q&a引用http://jmeter.512774.n5.nabble.com/Query-how-to-Test-web-services-in-Jmeter-2-10-td5718728.html

现在网上多以webservice(SOAP) Request来实现,但在实操时发现这个SAMPLE 添加不成功。其实可通过别的途径实现notice:Webservice (SOAP) Request has been removed by default from GUI as Element is deprecated. (Use HTTP Request with Body Data, see also the Template Building a SOAP Webservice Test Plan), if you need to show it, see property not_in_menu in jmeter.properties

There are two ways to test web services (SOAP requests): with HTTP Request and SOAP/XML-RPC Request
 In this case:

1. HTTP request
In HTTP Request Sampler fill:
   Server name: www.webservicex.net
   Path: /geoipservice.asmx
   Method: POST
   Body data:
 
 <?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetGeoIP xmlns="http://www.webservicex.net/">
      <IPAddress>10.1.1.1</IPAddress>
    </GetGeoIP>
  </soap:Body>
</soap:Envelope>

Add HTTP Header Manager,
   Content-Type: text/xml

2. SOAP/XML-RPC Request

Fill SOAP/XML-RPC Request sampler:

   URL: http://www.webservicex.net/geoipservice.asmx?wsdl
   Send SOAPAction: http://www.webservicex.net/GetGeoIP
   Soap/XML-RPC Data:
   <?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetGeoIP xmlns="http://www.webservicex.net/">
      <IPAddress>10.1.1.1</IPAddress>
    </GetGeoIP>
  </soap:Body>
</soap:Envelope>

方法一:http request

参考:http://jmeter.apache.org/usermanual/build-ws-test-plan.html

1、按模板创建Building a SOAP Webservice Test Plan


2、更改参数


方法二:SOAP/XML-RPC Request




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值