Guys
Is there a javascript method of accessing the SOAP XML data in a javascript variable populated from a web service?
For example, using the following JavaScript I can access the SOAP XML data (see example below) returned to a result variable.
result = service.ZDataService(); //Calls web service and returns SOAP envelope to result
for (var i in result)
{
form1.DropDownList1.addItem(i) // Populates drop down with Contents and ReturnContents values
for (var j in result[i])
{
form1.DropDownList1.addItem(j) // Adds Item, Item values to drop down
for (var k in result[j])
{
form1.DropDownList1.addItem(k) // I thought that this would add Name/Date to the drop down but it doesn't! How can I get further into the XML?
}
}
}
Below is the XML returned in the SOAP body.
<Contents>
<Item>
<Name>String</Name>
<Date>String</Date>
</Item>
</Contents>
<ReturnContents>
<Item>
<Name>String</Name>
<Date>String</Date>
<Item>
</ReturnContents>
I recognise that one method to deal with this would be to parse the XML and use XFA to access it. I am working on this in another thread.
However, are there any javascript experts out there who can advise the correct javascript to access the contents of the XML in a SOAP envelope when it is returned to a javascript variable.
If I can access the contents of the XML via javascript, I can then populate the values of form fields and drop downs etc etc.
Any ideas?
Many thanks
Rox