Forum Discussion
There are my Requirement
Step 1 : Created virtual service for service1
step 2: When hitting from client(soapui) getting response
Step3 : After 5 min from response of Service 1 ,I should get http post request xml for a a service 2 from serviceV PRO
Have tried some scripts in After request script option in ServiceV PRO
EX:
def doGET() {
try {
def http = new HTTPBuilder('http://soundly.me')
http.get( path : '/endpoint', query : [helowrld:'hi!'] )
{ resp ->
return resp.entity.content.text
}
}
catch(groovyx.net.http.HttpResponseException e)
{
println e.toString()
}
}
println 'doGET(): ' + doGET()
But no luck on this
Hi,
OK, one more time: ServiceV is an application that emulates web service running on web server. By definition, web server does not send requests but serves received ones and replies with responses. Thus, like any web server, ServiceV does not send requests. Point.
If the backend of your tested application implements the scenario that you mentioned, then this means that the backend actually consists from web server that responds to requests and web client that sends requests. And the tested client application consists of the same two parts: web client that sends initial request and processes obtained response and web server that processes obtained requests.
The backend must implement some sort of queue that is used to signal to the backend's web client to issue the request when backend's web server receives and processes initial request from web client.
Note, that web server must reply to the obtained request immediately, while subsequent request from backend web client in your scenario is issues in 5 minutes. This means that those two events (initial request processing and folow-up request generation) are loosely coupled.
With the above in mind, the possible design that I see is like this:
-- You need to create a code in ServiceV that will prepare data required to issue request by the backend web client and will store these data into some queue/storage (e.g. to the file);
-- ServiceV responds to the obtained initial request from web client in a usual way;
-- You will need to implement some application that will act as backend web client. This application will process the queue/storage and will issue request when there are data in the queue/storage.