ā05-13-2013 08:13 AM - edited ā03-14-2019 11:42 AM
Hello,
I have a two node setup (Hight Availability) of UCCX servers (version 8.5.1.10000-37). They will be upgraded to version 8.5.1..11004-25 this week. I have a script that communicates with an external server several times. For example:
Days = Create URL Document (path1)
Days = Create XML Document (Days)
TimeBeginHours = Get XML Document data (...)
It also sends information to the external server. For example:
View = Create URL Document (path3 + "add...")
View = Cache Document (View,100 KB)
Everything works fine. I would like to make the script independant of the external server, so that if the information from the external server can't be obtained, the script still works (by using default values, or skipping certain actions). Is there some way I could check if the XML file is reachable within the script? Or if the path itself is reachable?
Thank you for your help.
ā05-13-2013 09:40 AM
You can use one of the built in exception handlers in the script to continue with the script if xml file is unavailable.
Chris
ā05-13-2013 10:59 AM
Chris beat me to it but here are two great documents about the exception handlers not included in the normal product documentation:
https://supportforums.cisco.com/docs/DOC-26839
https://supportforums.cisco.com/docs/DOC-27235
Essentially you want to preceed the steps with an appropriate exception, set where it should goto in the event of a failure, and then set your failsafe logic/variables there. Don't forget to test once you think you have it! Sometimes it'll throw a different exception than you expected.. NullPointerException being the bear trap that usually gets me.
Please remember to rate helpful responses and identify helpful or correct answers.
ā05-13-2013 11:37 PM
Thank you very much for your answers.
However, I would like to avoid using exceptions, because I have a script full of places where I would have to use exceptions, and also, I already use the ContactInactiveException. Is there any other way to check if the external server or XML file is reachable?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide