Forum Discussion

Bavoux_Jean-Bap's avatar
Bavoux_Jean-Bap
Occasional Contributor
16 years ago

Simulate "no reply"

Hello,

I've created a service mock based on a wsdl file. It 's work and SOAPui was very easy to do that.

Now I'd like, that in some case, the mock doesn't send any reply.
I've created a groovy script that can easyly choose a reply, but I didn't find how to choose "no reply".

The only solution I've found, is to do a sleep that is longer than my client timeout.
It seemed to be fine ( works on a single request), but the sleep seems to "freeze" my mock.
If I try to send other request while , the first request has triggered the sleep method, my mock does not reply! Even if I want to stop my mock, I had to wait the end of the sleep.

Questions:
- is there a "nicer" way to prevent the mock for replying ( maybe return a special string  in my groovy_script)
- why my others request seem to be blocked by the first one. isn't SOAPui multithread?

Thanks

4 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    thanks for this, interesting scenario! I agree that soapUI shouldn't block other requests while sleeping; where did you put the script? In Mock Operation dispatch or the MockResponse?

    If you don't want the client to time out as you have done (which I think is a perfectly valid test), how would you like to "abort" the request? Just close the socket? Or return an empty HTTP response?

    regards!

    /Ole
    eviware.com
  • Bavoux_Jean-Bap's avatar
    Bavoux_Jean-Bap
    Occasional Contributor
    Thank you for you response.

    The Groovy script is a DISPATCH script. ( what you call "In Mock Operation dispatch", I guess )
    What do you mean with "in the MockResponse" ?

    The fact that the sleep blocks other requests is not really an issue, because it is acceptable that if my server doesn't reply to a request, it doesn't reply to next next ( simulating a network problem or a big server problem( infinite loop, memory crunch... )

    But this raises another issue.
    The service I've to mock normally takes several seconds to reply ( 1 to 10 seconds) but can handle multiple request simultaneously. The replies arrive not necessary in the same order than requests.

    If I simulate this with sleep in dispatch scripts, the requests won't be treated simultaneously, but sequencly. Will they?

    Thanks
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    you're right.. I've removed the synchronization here, of course soapUI should be able to dispatch several requests simultaneously. The upcoming nightly-build will contain this fix, let me know how it works for you.

    regards,

    /Ole
    eviware.com
  • Bavoux_Jean-Bap's avatar
    Bavoux_Jean-Bap
    Occasional Contributor
    Hi,

    Where can I find the "incoming nightly-build" ?
    (without rebuilding soapui from last svn )

    regards,

    JB