WSDL

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

JMeter Web Services Authentication and Parameterization Explained

  • And pass all required value like below

JMeter Web Services Authentication and Parameterization Explained

  • 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 hardcodedJMeter Web Services Authentication and Parameterization Explained

2. Authentication via SOAP request where token or session id has come in response

  • Add soap request like belowJMeter Web Services Authentication and Parameterization Explained

3. Pass login request like below

JMeter Web Services Authentication and Parameterization Explained

4. Suppose response for login request is coming like below

HTTP/1.1 200 OK

Content-Type: text/xml; charset=utf-8

Content-Length: length

<?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>

    <Authentication xmlns=”http://www.webservicex.net/”>

      <Status>

        <ReturnCode>success</ReturnCode>

        <Token>123asptrta3456gpt</Token>

      </Status>

    </Authentication>

  </soap:Body>

</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

JMeter Web Services Authentication and Parameterization ExplainedJMeter Web Services Authentication and Parameterization Explained

  • Second, capture token number generated in response to pass in a future request like below

JMeter Web Services Authentication and Parameterization Explained

  • Here, the token string will be stored in variable “token”. Now we can pass this token number in a future request like below

JMeter Web Services Authentication and Parameterization Explained

You may also like: How to Build a JMeter Test Plan for WSDL Services?

Leave a comment

Your email address will not be published. Required fields are marked *