c# - Implementing retry pattern for WCF call transient exceptions -


i have simple wcf soap service changes in db upon every call , returns response. i'm using servicechannel call client side code.

i want make sure client-side code not fail when service busy, have implemented retry pattern retry service call if exception caught. however, don't want retry if exception caused my code on wcf server side (if it's not connection-related, or if operationcontract code executed anyway (a timeout doesn't mean wasn't, right?)).

so want retry if

  1. i've sent request
  2. caught exception
  3. none of server side code in operationcontract method executed

microsoft article (link above) has no information types of exceptions transient. exception types should use catch need? or how should filter them?

inside wcf service implementation, within operation contracts catch exceptions happens throughout execution of code , return specific faultexception signal client service side code has run. may put special fault code or start fault exception message predefined sub string. on client side once catch fault exception check if sub string exists (or specific fault code s set on service code), if these exist means service side code has run , not need retry otherwise can retry. catch other exception types , retry well.


Comments