Forum Discussion

vavst4's avatar
vavst4
New Contributor
10 years ago

Issue testing asynchronous web-service

I'm running a multi-threaded load test using SoapUI open source edition. I'm testing an asynchronous web-service. I send requests to the service via SoapUI, these requests are queued for later execution, and the web service sends notification responses later.

I'm using a MockService to capture these notification responses. I now need a way of mapping each response back to the request that SoapUI originally sent out so that the latency from request to response can be tracked. To do this, I was going to define a ConcurrentHashMap. The test step that sends a request would update the hashmap with the request id and current time. When my MockService receives a notification response it would access the hashmap to get the start time of that request id.

The problem I'm facing is that I would need to declare the hashmap in a scope where all the threads access the same hashmap and the MockService also has access to it.

If I declare my hashmap in a groovy test step, then each thread when executing the test step would create its own copy of it, which is not what I want.

My question is whether there is a way in SoapUI to declare my hashmap at a "global" scope so that all the test threads (and my MockService) can access the same hashmap instance?

I tried declaring it in the setup script of the TestSuite and adding it to the TestSuite context but that doesn't seem to be working.

Can someone help with this?

1 Reply

  • nmrao's avatar
    nmrao
    Champion Level 3

    In this case the following comes to my mind.

    You would need to write some kind of listener which can handle the webservice notifications and do the processing further. And this listener you may start it in the TestSuite setup script. So you can choose the preferred language groovy/java to do the same. Hope this helps.