Last post Nov 09, 2016 05:40 AM by Chris Zhao
Nov 08, 2016 03:08 AM|nrk_hi|LINK
I am creating a WCF Service using c#.I want some suggestions on what is the best way to reconnect wcf service.
for example, during some operation due to network issues wcf connection is lost so how can I reconnect during operation. one more example is during some operation some exception occured here i want to reconnect wcf service again.need some suggestions on these.
Nov 08, 2016 05:13 AM|navakiran|LINK
There are many ways to do that.
1. In the middle of the operation, If you get an exception and you would like to retry it. In this case simply declare a retryCount (=2) variable and loop it if exception is happend.
2. If you would like to handle it in background process, then log the failures (In DB or file). Create a new background job to retry these jobs.
Nov 09, 2016 05:40 AM|Chris Zhao|LINK
You could use try...catch.. block to detect exception occurs during operation call, and try regenerating the client proxy object and connect to the service again.