01-11-2011 01:43 PM - edited 03-14-2019 07:10 AM
Hi,
I have written a script that uses the Create URL Document step to retrieve an XML file from an external web server.
If the web server hosting the XML file is unavailable I want the script to detect this and then run some steps.
My issue is how do I do this. The Create URL Document has a timeout box with a default value of 0 milliseconds. However the step does not have successful and timeout branches from it so I am unsure how/if I can get the script to detect the problem.
The Create URL Document step is followed by a Create XML Document step then a Get XML Document Data step.
Thanks
Solved! Go to Solution.
01-11-2011 02:04 PM
You can use the IF step to check the results of Create URL Document step. If the data is not available, the results should be null or some something unexpected that you can test for. If this condition is met, branch off and run the error handling step.
01-11-2011 04:09 PM
Assuming your url document name is URLDoc, try putting this in your IF statement test:
URLDoc == null
If that's true, then the value is null. If it's anything else, it will return false.
Cliff
01-11-2011 02:04 PM
You can use the IF step to check the results of Create URL Document step. If the data is not available, the results should be null or some something unexpected that you can test for. If this condition is met, branch off and run the error handling step.
01-11-2011 02:54 PM
Thanks for the response.
I cannot work out what the IF condition should be.
The document variable used by the Create URL Document is set to null within the script.
If, after the Create URL Document step runs, the value of the document variable is still null then I guess that means that the document was not retrieved from the web server correctly.
I have tried various conditions in the IF statement but keep getting an unable to parse expression message.
Any ideas?
01-11-2011 04:09 PM
Assuming your url document name is URLDoc, try putting this in your IF statement test:
URLDoc == null
If that's true, then the value is null. If it's anything else, it will return false.
Cliff
01-12-2011 01:01 AM
Clifford,
Thanks - I was only using one = in my IF condition. Changing this to == solved the problem.
Thanks
12-16-2011 09:39 AM
James,
I am modifying the holiday.aef to access an xml located on a remote web server. Would you mind sharing your script so that I could see how you accomplished your goal? I would truly appreciate it.
Thanks
01-04-2012 10:30 AM
I am also trying to modify scripts to use this process. This is a very helpful post. Could someone please post an example script. Thanks!
01-04-2012 11:00 AM
I can't see the option to attach a file but here's a screenshot of the modification to the default holidaycheck.aef script to retrieve from a web server. I have declared a variable named DATES_FILE_LOCATION pointing to of the file on the web server. The script uses the URL construct to retrieve the document as shown.
01-04-2012 12:08 PM
thanks. if you are ok with e-mailing script, my e-mail is eguidry@presidio.com.
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