Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help displaying a SOAP array in JavaScript

Status
Not open for further replies.

solovengo

Technical User
Nov 19, 2007
2
US
This code should display values being returned in a SOAP/XML array of user names (strings) and their permissions (strings). The debugger/variables tool I am using at breakpoints shows the values are being returned in the XML response, but I can't get them to print in the TDOutput window. The line, "User: undefined" prints for every user in the DB, so "node" seems to be null. Any ideas what is wrong here? Thanks for any help.

// call SOAP method : ArrayOf_tns3_IcpUser getUsers ( )
var result2; // Array of String
result2 = soapIcpTransactionAdapterService.getUsers();
result2 = XTools.WrapArray(result2);
for (i = result2.lbound(); i <= result2.ubound(); i++) {
node = result2;
TDOutput.Print("User: "+node);
}
 
Try one of the following:

node.nodeValue
node.firstChild.nodeValue
node.nodeText

Failing that, inspect "node" using Firebug (or similar tool for whatever browser you use) and see what the relevant property is.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Thanks for the reply Dan. Yes, I tried those, and many others. The automation testing tool I am using is Test Director. It has a Variable window that can be used to see what the values are at breakpoints. In the Variables window I can drill down into the SOAP array and see that a value exists, but when I use the property name in the JavaScript print function, it prints nothing. Still looking...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top