I have an ASP app that interfaces with an app that returns its results in XML. I have had a randomly recurring problem with the server returning an "Object Required" error message regarding my "TopNode" which is the XMLDoc.FirstChild. I have tried various ways of error checking, with no improvement, and Am now trying the "Validate" method. Can anyone tell me if the following code makes sense, Since the error occurs randomly and I have no way of truly knowing if this will capture the error.
ResponseXML = agent.SendRequest(RequestDoc.XML)
Set XMLDoc = Server.CreateObject("MSXML.DOMDocument"
XMLDoc.loadXML(ResponseXML)
Set ValidateError = XMLDoc.validate
if not ValidateError.errorCode <> "" then
set rsp= XMLDoc.selectSingleNode("/rca_response"
if rsp.text <> "" then
Set TopNode = XMLDoc.firstChild
If TopNode.NodeName = "rca_response" Then
Set ResponseNode = TopNode.firstChild
If Responsenode.NodeName = "response" then
Set resultNode = responseNode.firstchild
If resultNode.NodeName = "error" then
my processing...
else
other processing...
end if
end if
end if
end if
end if
I know that there is a lot of VBScript in there as well, butI thought that if i diplayed the whole logic, it would make it a little easier.
I have also tried "If topNode.haschildnodes()or topnode is nothing then.."
I know there has to be amore efficient way of doing this.
thanks for indulging a fool.
ResponseXML = agent.SendRequest(RequestDoc.XML)
Set XMLDoc = Server.CreateObject("MSXML.DOMDocument"
XMLDoc.loadXML(ResponseXML)
Set ValidateError = XMLDoc.validate
if not ValidateError.errorCode <> "" then
set rsp= XMLDoc.selectSingleNode("/rca_response"
if rsp.text <> "" then
Set TopNode = XMLDoc.firstChild
If TopNode.NodeName = "rca_response" Then
Set ResponseNode = TopNode.firstChild
If Responsenode.NodeName = "response" then
Set resultNode = responseNode.firstchild
If resultNode.NodeName = "error" then
my processing...
else
other processing...
end if
end if
end if
end if
end if
I know that there is a lot of VBScript in there as well, butI thought that if i diplayed the whole logic, it would make it a little easier.
I have also tried "If topNode.haschildnodes()or topnode is nothing then.."
I know there has to be amore efficient way of doing this.
thanks for indulging a fool.