SoapUI - Request & Response



Request Setup

Here, we will perform the conversion of the currency from INR to USD.

  • FromCurrency – INR
  • ToCurrency – USD

Next, enter these inputs in the place of the question mark which will be sent as a request XML. After placing those values into the corresponding XML tags, click 'Submit request' button to check the response.

Submit Request

Response

Upon submitting a request, the web service request is processed by the web-server and sends back a response as shown in the following screenshot.

By reading the response, it can be concluded that 1 unit of INR = 0.0147 units of USD.

Web-server Response

HTTP Request

SOAP messages are transported by HTTP protocol. To view the HTTP request, click RAW at SoapUI Request window (left side).

HTTP Request

The Request is posted to the web-server. Hence, the POST method of Http is used.

The SOAP Request is transported in the body of the http message, which is shown as follows.

POST http://www.webservicex.com/currencyconvertor.asmx HTTP/1.1 
Accept-Encoding: gzip,deflate 
Content-Type: text/xml;charset = UTF-8 
SOAPAction: "http://www.webserviceX.NET/ConversionRate" 
Content-Length: 353 
Host: www.webservicex.com 
Connection: Keep-Alive 
User-Agent: Apache-HttpClient/4.1.1 (java 1.5) 

HTTP Response

Click the 'RAW' Tab in SOAP-UI Response Window to understand how the response is sent via HTTP.

After processing the request, the http response code (200) is shown which means it is a success. The web-server has processed it successfully.

The SOAP response is sent back to the client as part of the body of the HTTP message.

HTTP/1.1 200 OK 
Cache-Control: private, max-age = 0 
Content-Type: text/xml; charset = utf-8 
Content-Encoding: gzip 
Vary: Accept-Encoding 
Server: Microsoft-IIS/7.0 
X-AspNet-Version: 4.0.30319 
X-Powered-By: ASP.NET 
Date: Sun, 22 Jan 2017 19:39:31 GMT 
Content-Length: 316 

Http Response

Following HTTP codes are used to send in responses by the Web-server and are very useful for debugging.

HTTP Code Description

1xx:

Informational − This means a request was received and there is a continuing process.

2xx:

Success − The action was successfully received, understood, and accepted.

3xx:

Redirection − This means further action must be taken in order to complete the request.

4xx:

Client Error − This means the request contains a bad syntax or cannot be fulfilled.

5xx:

Server Error − The server failed to fulfil an apparently valid request.

Advertisements