Table of Content
HAL Forum
function boolean XmlNodeExists (
xml XMLData,string NodePath)
Description:
Checks if the specified node exists in the xml data. Returns FALSE if node not found
Parameters:
XMLData Parsed xml data
NodePath Path to the target node in the XML data in format "parent\child\grandchild\etc".
function boolean MessageIsFault(xml x,var string errormsg)
begin
  boolean res;
  string 255 resString;
  
  errormsg = "";
  if (XmlNodeExists(x,"SOAP-ENV:Envelope/SOAP-ENV:Body/SOAP-ENV:Fault/faultcode")) then begin
    errormsg = XmlGet(x,"SOAP-ENV:Envelope/SOAP-ENV:Body/SOAP-ENV:Fault/faultcode");
    res = true;
  end;
  
  if (XmlNodeExists(x,"SOAP-ENV:Envelope/SOAP-ENV:Body/SOAP-ENV:Fault/faultstring")) then begin
    errormsg = errormsg & " : " & XmlGet(x,"SOAP-ENV:Envelope/SOAP-ENV:Body/SOAP-ENV:Fault/faultstring");
    res = true;
  end;
  
  MessageIsFault = res;
  return;
end;  
Related topics:
««