Forum Discussion

latham187's avatar
latham187
Occasional Contributor
14 years ago

Http Status Code 204 not recognized as Valid or Invalid Code

Hi,

I am trying to create an assertion using Valid Http Status Code 204 (No content), however soapUI is not recognizing 204 as a Valid or Invalid code.

Suggestions?

Thanks,
Matt
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    Can you provide us how did you set assertions and what is raw request/response ?

    robert
    /SmartBear
  • latham187's avatar
    latham187
    Occasional Contributor
    The raw response is:


    HTTP/1.1 204 No Content
    Connection: close
    Date: Wed, 21 Sep 2011 21:06:27 GMT
    Content-Length: 0
    X-Powered-By: Servlet/2.5 JSP/2.1



    I tried both invalid and valid http status code assertion types and both fail when this response is returned. I am expecting this to pass one way or the other.
  • RJanecek's avatar
    RJanecek
    Regular Contributor
    you can add script assertion to assert header. Here I expecting 405:

    def header = context.currentStep.getHttpRequest().getResponse().properties["responseHeaders"]
    assert header["#status#"].toString().contains("405 Method Not Allowed")
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    RJanecek wrote:
    this isnt charm, this is groovy
    you are welcome

    Haha

    /Henrik