Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

* How to return valid xml to an xml databank from JS

Options
LegacyForum
LegacyForum Posts: 1,664 ✭✭
Using a Javascript method, how do I return valid XML to a chained XML Data Bank? Attempting to return a string value from Javascript results in:

Tool "XML Data Bank" did not accept output from method "Method"

Can this be done within the JavaScript method AND/OR in the UI through a chained tool? Python allows the use of: SOAPUtil.getXMLFromString; can I get JavaScript to use the same util?

Here is my example method:

CODE
function randomString() {
   var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
   var string_length = 8;
   var randomstring = '';
   for (var i=0; i<string_length; i++) {
       var rnum = Math.floor(Math.random() * chars.length);
       randomstring += chars.substring(rnum,rnum+1);
   }
return randomstring;
}