Popular Posts

Tuesday, February 26, 2013

How to configure soapUI to send HTTP chunked encoded requests

soapUI makes use of Apache HttpClient (based on HTTPComponents project) as the client side HTTP implementation. When submitting requests using soapUI, you may have noticed that, the requests always send Content-Length HTTP header. You can find it out in the Raw View of the request editor.

POST http://localhost:9000/services/SimpleStockQuoteService HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "urn:getQuote"
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost:9000
Content-Length: 416

In functional and non-functional testing, we usually need to test the servers by sending HTTP requests with both Content-Length as well as chunked transfer encoding. How can we configure soapUI to send chunked encoded requests instead of Content-Length?

Step 1

Click on Global soapUI Preferences icon in the main tool bar (Or else, click on File --> Preferences)

Step 2

HTTP Settings tab will be selected by default. You will notice Chunking Threshold option. By default this is set to empty so that the chunking is disabled for any HTTP request.















Update this field with non negative integer value (e.g:- 1) and resubmit your request. You will notice chunked encoded request as shown below.

POST http://localhost:9000/services/SimpleStockQuoteService HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "urn:getQuote"
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost:9000
Transfer-Encoding: chunked

For more information about various soapUI tips and tricks, read Web services Testing with soapUI book.

2 comments:

Vivek said...

Hi Charita,

Which version of SoapUI do you use?

I tried with 3.5,and chunking was enabled when I set a positive integer value (+5 in my case).

shammi Dhananjaya jayasinghe said...

Hi Charitha,

With SoapUI 5.1.3, I could not enable gzip with configuring chunking threshold . But i could get it done by enabling gzip in the drop down of the field Request Compression .

Thanks
Shammi