Forum Discussion
https://www.soapui.org/soap-mocking/deploying-mock-services-as-war-files.html
What you can do is generate war and see web.xml where it shows place holder for scripts.
By the way, interesting to see your use case. If possible, please elaborate.
- Lavalyte8 years agoOccasional Contributor
I know you can put groovy scripts in to be called at various points, but what I would like to be able to do is write some overarching code so I can do things like keep an object in memory across multiple web method calls.
In my use case I have have several web methods that build up a request into an external system. I want to be able to store objects in memory to represent these requests, and would rather have code external to the web method hooks to represent the structure and storage of the requests.
For example, I would like to instantiate the map that stores the requests here, and just let the scripts look up the map to get the request to work with it.
Further, this would be the cleanest place if I want to instantiate globally available stuff like lists of mock customer names or street names or similar and don't want to push that stuff into a database table.
- rupert_anderson8 years agoValued Contributor
Hi,
Please see if my answer to your other post helps:
Using a custom Groovy lib jar works OK as a means to centralise and reuse scripts across SoapUI.
Regards,
Rupert
- Lavalyte8 years agoOccasional Contributor
I guess there is two issues here... firstly how to centralise common functionality, secondly how to run code independent of services called on deployment of the generated war.
The first part has been resolved, the second hasn't been.
There are ways I can initiate on demand for everything, but I would rather have a central initiation point that I can expect to be run on deployment.
- Lavalyte8 years agoOccasional Contributor
Perhaps the project Load Script does this?
- Lavalyte8 years agoOccasional Contributor
No-one has general startup tasks to do on a deployed soapui war?
Related Content
- 8 years ago
- 11 years ago
- 4 years ago
Recent Discussions
- 2 days ago