2

Is there possible create SoapUI Mock service that not return response but it is just closing connection?

1 Answer 1

2
+50

I'm quite sure what you're asking for is not possible with SoapUI MockServices. There are some extensive possibilities involving scripting, and it is even possible to access the underlying javax.servlet.http.HttpServletRequest and Response objects. Have a look here for details:

http://www.soapui.org/Service-Mocking/creating-dynamic-mockservices.html

Using scripting, it is possible to write a mock service request handler like this in SoapUI that just resets and closes the output stream:

mockRequest.getHttpResponse().reset();
mockRequest.getHttpResponse().getOutputStream().close();

But the client will still see a HTTP response header like this generated by the servlet container:

HTTP/1.1 200 OK
Content-Length: 0
Server: Jetty(6.1.x)

It is generally not possible to abort the connection immediately from inside a servlet (which is what SoapUI mock services are built upon). Have a look here about this topic:

How to close a HTTP connection from the HttpServlet

I'd use something completely different than SoapUI, most likely a scripting technology like PHP or Perl to achieve what you're asking for.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.