Thank u so much Dan


Hi dan, is this method possible in Eureka?


Eureka has an older SOAP API.   I've adjusted the script to work off of the older API but it does not have an xml escape function.



//unrelated values that may also be needed for the same function


var parmOne = "Example 1";


var parmTwo = "Example 2";



var elementArray = ['Data 1','Data 2','Data 3']; //example of array containing unknown number of elements


var xmlString = '';



var sm = new SOAPMessage('YourSoapMessage', 'SOAPMessageFunction');


sm.setParameter('StaticParm1', parmOne);


sm.setParameter('StaticParm2', parmTwo);



for (var i = 0; i < elementArray.length; i++) {


  //build XML elements


  xmlString += '<exampleElement>' + elementArray[i] + '</exampleElement>'


}



sm.setParameter('complexType', xmlString);


sm.post();




If that does not work, you could build the SOAP message from scratch.   This highly depends on what your WSDL looks like but here is a small snippet using your example.   I also must say, I've never actually used this approach.   This is all in theory based on the wiki article here.



var envelope = new SOAPEnvelope();


var complexType = envelope.createBodyElement("complexType");



for (var i = 0; i < elementArray.length; i++) {


  //build XML elements


  envelope.createElement(complexType,"exampleElement",elementArray[i])


}



var req = new SOAPRequest("http://endpoint.com");


req.setSoapAction("http://endpoint.com/action_header");


req.post(envelope);


Hi Dan, once again thank you for the timely response, so there is no escape method in older SOAP api but will this method work s.setXMLParameter('complexType',xmlstring).


Also in fuji version we have a function getRequestBody(), so using this we can preview the request xml after executing the soap message. Likewise is it possible to preview the xml in eureka? This information would help me a lot.


idk why this is marked as the correct answer. it does not work. i'm trying to do the same type of thing some client wants values from a list collector broken out in individual tags rather than comma separated like the designs and this doesn't achieve that. did you actually try this dan?