I have access a lists.asmx on a SharePoint farm which I normally access to update the list items. Lists.asmx perfectly authenticate my client during the day time but fails during night time (due to system maintenance). I want to ensure that my client keep trying to connect to the service (say upto 1 hour). what options would you like to suggest here? Do we have something available out of the box here, or I will have to write my own code at the client side? What should the design of the class look like if I will have to write my own retry code at client side?
Share
An out of the box solution is the Timeout value of the webservice. I handle SharePoint webservice errors on the server side with a Try/Catch block and either silently abort or report an error to the user after a second attempt. For instance, if you had a function to get the List GUID from the display name you would use (in VB) . . .
. . . where a request timeout cancels the request. If the webservice returns another error in your case, it can be handled in the Catch Other section.
I wouldn’t just set the ws.Timeout value to 3600000 because the web server will most likely be set to force a timeout before the hour is up. Instead, you could use a timing loop in the Catch block (or in the code that calls this function) and make the webservice call again at set intervals. Within that code you would want to limit the number of calls to the webservice routine to avoid an infinite loop.