How to implement timeout and retry while accessing a web service before throwing an error?
-
I am developing a WP8 application. I created a web service on out-systems and then I am calling those web service methods in my app: ServiceReference1.WebServiceClient ws = new WebServiceClient(); ws.FetchInboxAsync(EmailId); Now what I want is 10 seconds timeout while trying to access the web service and retry 3 times before throwing an error but I am not sure how to achieve this.
-
Answer:
WebServiceClient is no standard class which exists in WP8. You will have to provide details about the connection layer you are using. I assume you are ussint httpWebRequest for the connection. In this case, you can view this thread for details on how to define the timeout. After 3 timeouts you will then have to return an exception or error message. http://stackoverflow.com/questions/15038875/how-to-set-timeout-for-httpwebrequest-in-windows-phone-8-app
rituraj346 at Stack Overflow Visit the source
Related Q & A:
- How To Send a Complex Object to a Rest Web Service?Best solution by codeproject.com
- How to call a web service using HttpWebRequest?Best solution by Stack Overflow
- How to call .aspx page from a web web service(service.svc?Best solution by Stack Overflow
- how to consume a web service in mule flow?Best solution by Stack Overflow
- How do I forward gmail raw email to a web service?Best solution by email.about.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.