Hi David,
You should be able to call getDocument("") from the JavaScript from version 4.4.3. This supports Web Services too (web services is an extension to the XML).
The example should be exactly the same.
An example:
XML Example response:
Code: Select all
<ns:purchaseOrder xmlns:ns="http://www.ebasetech.com">
<items xmlns="http://www.myshop.com">
<item>
<name>Hairspray</name>
<price>0.99</price>
<quantity>3</quantity>
</item>
<item>
<name>Shampoo</name>
<price>1.99</price>
<quantity>1</quantity>
</item>
</items>
<name>Fred</name>
<name>Rachel</name>
</ns:purchaseOrder>
Code: Select all
//call my web service
resources.WS_WEB_SERVICE.call();
//get the response document MY_RESPONSE
var response = resources.WS_WEB_SERVICE.getDocument("MY_RESPONSE");
var xmlDoc = new XML(response);
//navigate the document
for each(var name in xmlDoc.name)
{
log("NAME:: " + name.toString());
}
for each(var name in xmlDoc.*::items.*::item.*::name)
{
log("ITEM NAME:: " + name.toString());
}
I am confused when you say there is no response document, there should be one, if the web service resource has it configured.
Note that the root element of the XML document starts at the declared XML variable.
Also note that the "*::" before the nodename is a wildcard to match all nodes of that name.
Hope this helps
Steve