Pressure test of WebService with JMeter

Source: Internet
Author: User

pressure test of WebService with JMeter
in the real world we used jmeter to stress test WebService, Apache JMeter is a Java-based stress testing tool developed by Apache. Used for stress testing of software.
the role of JMeter1. Be able to test the HTTP and FTP server for stress and performance, or perform the same test (through JDBC) for any database. 2. Full portability and 100% pure java. 3. Full Swing and lightweight components support (precompiled jar using javax.swing.*) package. 4. A fully multithreaded framework allows simultaneous sampling through multiple threads and the ability to simultaneously sample different functions through separate thread groups. 5. The careful GUI design allows for fast operation and more accurate timing. 6. Caching and offline analysis/playback of test results.

Second: The configuration of the relevant environment variables for JMeter is similar to the configuration of Java, refer to the information on the Internet

Three: JMeter The WebService Test instance for the HTTP protocol.
1: First create a new thread group in the test plan

The number of threads in thread properties and number of cycles indicates the number of times the actual run was performed at the time of the test, that is, the number of accesses to webservice.

2: Create a new HTTP request under the thread group (about the configuration of the provider's related address and some parameters) and the HTTP information manager (Public request header when sending the WebService service), and aggregate the report (test report).

Four: After you have configured everything, click Start to perform the test.
=============we Test WebService by HTTP head start===========
=============we Test WebService by HTTP head end===========

Note ==================================== The following configuration for WebService services is integrated into spring

<?xml version= "1.0" encoding= "UTF-8"?>
<beans xmlns= "Http://"
Xmlns:xsi= "Http://" xmlns:jaxrs= "Http://"
xmlns:context= "Http://"
Xsi:schemalocation= "
Http:// " >
<import resource= "Classpath:meta-inf/cxf/cxf.xml"/>

<jaxrs:server id= "Restcontainer" address= "/" >
<jaxrs:serviceBeans><!--here to configure your WebService bean definition. Reference
<!--<ref bean= "Orderwebservice"/> <ref bean= "Merchantwebservice"/>--
<ref bean= "Clearuserwebservice"/>
<ref bean= "Merchantwebservice"/>
<!--<ref bean= "Balancewebservice"/>--
<entry key= "JSON" value= "Application/json"/>
<entry key= "xml" value= "Application/xml"/>
<!--<ref bean= "Jsonexmapper"/>--
<ref bean= "Jaxbprovider"/>
<ref bean= "Jsonprovider"/>

<bean id= "Jaxbprovider" class= "Org.apache.cxf.jaxrs.provider.JAXBElementProvider"/>
<!--******************** using Jackson as the serializer ***********************--
<bean id= "Jsonprovider" class= "Org.codehaus.jackson.jaxrs.JacksonJsonProvider"/>


The CXF plugin configuration in the Web. xml File WebService

Configuration of the Web service service in Java
Package com.iboxpay.clear.webservice;

Import Javax.annotation.Resource;

Import Org.springframework.stereotype.Service;

Import Com.iboxpay.clear.service.SysResourceService;

@Path ("/clearpro")
@Service ("Clearuserwebservice")
public class Clearwebservice {

Private Sysresourceservice Sysresourceservice;

@Path ("/dispath")
@Produces ({mediatype.application_xml, Mediatype.application_json})
@Consumes ({mediatype.application_xml, Mediatype.application_json})
public string Dispath (string jsonstr) {
System.out.println ("=============we Test WebService by HTTP head start===========");
System.out.println (JSONSTR);
System.out.println ("=============we Test WebService by HTTP head end===========");
Return "Can You";


If you need to see the results returned in JMeter after performing the test, we need to create a new view result tree (right-click Thread Group > Add > Listener > View results tree) below the thread group, and in the Response data column you can see the results returned by the response

Pressure test of WebService with JMeter

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.