SOAP Scripting returning multiple values using getXMLFromString
I do see some discussion thread awhile back with the that getXMLFromString works with multiple values.
Discussion: One to Many Data with XML Data Bank and Writable Data Source.
I have tried to applied the same concept on Groovy. But, it doesn't seems to work. I am planning to put those data into a writable datasource. I know splitting two different method calls would work. I was just thinking maybe there's a better ways than doing that.
Here's the script example:
import soaptest.api.*;
public activateRegression( input, context ) {
Regression = "TRUE"
myPath = "FALSE"
return SOAPUtil.getXMLFromString( [myPath, Regression ] )
}
Here's the error. It does not support an array list.
Error Message:
DataSource: X (row 1): Error during script execution. View Details for more information.
No signature of method: static soaptest.api.SOAPUtil.getXMLFromString() is applicable for argument
types: (java.util.ArrayList) values: [[FALSE, TRUE]]
Possible solutions: getXMLFromString([Ljava.lang.String;), getXMLFromString([Ljava.lang.String;,
boolean)
Additional Details:
No signature of method: static soaptest.api.SOAPUtil.getXMLFromString() is applicable for argument
types: (java.util.ArrayList) values: [[FALSE, TRUE]]
Comments
-
I do see another thread instead of using XML build a JSON output instead and write it to databank. I manage to resolve the issue this way. Thanks.
0 -
As the error message suggests, SOAPUtil.getXMLFromString() does not take an ArrayList as an argument. Instead, it takes a String array.
In case this helps, there's an answer on Stackoverflow:
How do I convert a Groovy String collection to a Java String Array?1 -
thanks benken_parasoft, you are right it's treating it as a list.
0