The Web Services Description Language is an XML format that is used to describe the functionality of a web service. This web service works according to rules mentioned in a WSDL file.
All the public information like the weather, converting and validating information is described by webs services. Here, the information is available for anonymous users. However, information can be both private and personal. But, the information must be secured and provided only to authorized users.
Web Services Authentication Steps
1. User ID and Password parameterization (Refer user id and password from file)
- Open notepad and list out all user id and password and save this in the same location where your JMeter script is. Say file name is username_pwd.csv
- Add CSV Config Data in the script
- And pass all required value like below
- Here “username” and “password” are variables where the value will be store during execution
- Let’s pass these variables in XML request where username and password are hardcoded
2. Authentication via SOAP request where token or session id has come in response
- Add soap request like below
3. Pass login request like below
4. Suppose response for login request is coming like below
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
<?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/”>
- After getting above response in JMeter, validate response whether it is a success or failure. For this, insert assertion for login request like below
- Second, capture token number generated in response to pass in a future request like below
- Here, the token string will be stored in variable “token”. Now we can pass this token number in a future request like below
You may also like: How to Build a JMeter Test Plan for WSDL Services?