SmartBear / soapui

SoapUI is a free and open source cross-platform functional testing solution for APIs and web services.
http://www.soapui.org
Other
1.56k stars 607 forks source link

Issue with REST Mock service Response, when response code 204 No Content. #764

Open oscarislasleyva opened 1 year ago

oscarislasleyva commented 1 year ago

This bug was originally reported by VinayKumar2 on the community site, but I recently noticed it too.

https://community.smartbear.com/t5/SoapUI-Open-Source-Questions/Issue-with-REST-Mock-service-Response-when-response-code-204-No/td-p/228777

Below, I transcribe part of it here, but all the evidence is in the previous link.

... Hello,

I am facing a weird issue when I try to build a REST mock service that needs to just return "204 No Content" in response.

I have used SOAP UI 5.5.0 and SOAP UI 5.7.0, attached is a simple project that replicates this problem. When the HTTP status code in the mock response is set to "200 - OK", works fine. When the HTTP status code in the mock response is set to "204 - No Content", then the below response is sent back from SOAP UI to the client is not working. Client is giving an error "An error occurred whilst performing a TCP/IP socket operation. The Content Length was invalid. ...

jhbmach commented 1 year ago

We are facing the same problem. It seems that a Content-Length header with a positive value ist only send by SoapUI if the request contains a Accept-Encoding header with values 'gzip' or 'deflate'. For a workaround we can remove this header from our request and we get a response from SoapUI that we can handle without errors.