How to call Custom JAR method with arguments
I am using JAR inside the JSON Message Responder "Response" tab to return the response.
One of the method in the JAR expects the method arguments.
1. How can I send the arguments to method inside the JAR, from the JSON Message Responder?
2. In local machine, I can set the Custom JAR file path in the System Properties. In the server, where should I keep the JAR file and how can I set the JAR file path?
Comments
-
0
-
Hi,
For where to place the jar file on the server please see this documentation page and search for "system_jars", the location you want to put the jar will be in the workspace the server in a folder named "system_jars" under the "VirtualAssets" project.
https://docs.parasoft.com/display/SOAVIRT9106/Additional+Preference+Settings
For calling a method on a class in the jar file the choices are either a method that takes no argument or a method that takes a single argument which would be of the type com.parasoft.api.ScriptingContext
From the scripting context, you can then access data sources or data banked values.
This documentation page has more information about using scripting
0 -
You can also write a small Groovy/Jython script that takes the expected arguments. Your script can read whatever settings it needs from the ScriptingContext object and then invoke whatever methods from your jar with the arguments they expect.
0