Forum Discussion

hermanns's avatar
13 years ago

"null/empty response" when using Status Code Assertions

Hi everybody,

I have a RESTful Webservice which returns a Http Status Code 204 (No Content).
I would like to validate that result using Soap UI Assertions.

So i inserted the assertion "Http Valid Status Codes" with Code 204.
But whatever i do - soap ui complains that it receives a "null/empty response"!

When I look into the RAW Result, I see - as expected - that I got an HTTP 204
from my REST-Service (please have a look at my attachment).
So it seems like a bug to me that soap ui complains that the response is empty!
I would expect that the test case is green, since I got the expected HTTP Status Code.

To workaround this problem, my Restservice simply returns something arbitrary - e.g. '-'.
Than soap ui doesn't complain any longer about the empty content of the response
(ok - it is no longer empty now . But I think this is not what we want

Am I missing something?
Thanks for any response,
Dirk

1 Reply

  • You may try putting assertion for null using script assertion, and then for Valid Http Status Codes, copy the following to script assertion
    assert messageExchange.hasResponse() == false

    And then put Valid Http Status Codes assertion

    It should work