Setting up a project in Soap-UI and playing around with soap requests and responses

We can go to SoapUi -. New project and add our locally running Webservice to it by adding the WSDL of that service to that project while creating the project Then we can right click our project and add a new testsuite ,then test case and then a new test step.We add a new Soap request and select request login from list of available options

Then we run this login request we can add our username and password and click run to see the response we get for this login soap request

Our typical soap based login request will look like this

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:RetailApp">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:RetailLogin soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <credentials xsi:type="nam:credentials" xmlns:nam="http://localhost/retail/namespaces">
            <!--You may enter the following 2 items in any order-->
            <username xsi:type="xsd:string">myUsername</username>
            <password xsi:type="xsd:string">myPasswordk</password>
         </credentials>
      </urn:RetailLogin>
   </soapenv:Body>
</soapenv:Envelope>

In the response we see login success and we see the session id.

Then we add a new soap request as test step and we select add category from list of options as the request

Then in that category we add the same username, add a new category shoes and add same session id which we got from the response of login request. When we run this request we see in the response that shoes were added.

Then we edit the soap request and add more categories including the shoes category. And in the response we will see that shoes category will not be added as it is already there.