Forum Discussion

VinayKumar2's avatar
VinayKumar2
New Contributor
3 years ago

Issue with REST Mock service Response, when response code 204 No Content. In SOAPUI 5.7.0

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."

 

Response from SOAP UI to client:

 

HTTP/1.1 204 No Content
Content-Type: application/json
Content-Encoding: gzip
Content-Length: 20
Server: Jetty(6.1.26)

 

 

Note : This exact same REST mock service project works perfectly when imported into Ready API 2.8.2. Client received response from ready api works fine and no exception raised.

 

Response from READY API to client:

 

HTTP/1.1 204
Date: Thu, 20 Jan 2022 16:55:52 GMT
Content-Type: application/json
Content-Encoding: gzip
Content-Length: 20

 

 

Attached detailed soap ui, ready api and client exception logs.

 

Thanks,

Vinay