Hi guys,
I have a script which connects to a web service on the web and fills up some parameters which are then echoed out to some of my pages. Sometimes the service can be very unrealiable and so my webpage will only load half way then it times out while trying to connect to the soap service (it isn't my code).
I was thinking of running the web service call as a cron job and populating some fields with the result of the service call. I can then check on my page to see if the values are not empty then display them. This will save a call to the service and so won't break my page if it times out.
The thing i'm not sure about is how I will assign variables to store the result of the cron job. Say I run the script every night at midnight can I assign the results to some server variables which will still be accessible by every call to my webpage at any time in the next 24 hours until the script is ran again? Basically I just want to minimise the risk of letting a faulty web service connection prevent my pages from fully loading.
Just not sure what way is best to work this.
Thanks
I have a script which connects to a web service on the web and fills up some parameters which are then echoed out to some of my pages. Sometimes the service can be very unrealiable and so my webpage will only load half way then it times out while trying to connect to the soap service (it isn't my code).
I was thinking of running the web service call as a cron job and populating some fields with the result of the service call. I can then check on my page to see if the values are not empty then display them. This will save a call to the service and so won't break my page if it times out.
The thing i'm not sure about is how I will assign variables to store the result of the cron job. Say I run the script every night at midnight can I assign the results to some server variables which will still be accessible by every call to my webpage at any time in the next 24 hours until the script is ran again? Basically I just want to minimise the risk of letting a faulty web service connection prevent my pages from fully loading.
Just not sure what way is best to work this.
Thanks