title: WCF Client Extensibility: IParemeterInspector.AfterCall and exception handling
body: <p>For my WCF client, I'd like to be able to do some <strong>pre</strong> and <strong>post</strong> work for every operation of a given endpoint.</p>
  
  <ul>
  <li>The <strong>pre</strong> work would like to make use of the <strong>operation name</strong> and the <strong>input arguments</strong>.</li>
  <li>The <strong>post</strong> work would like to make use of (again) the <strong>operation name</strong> and the <strong>original input arguments</strong> as well as the <strong>outputs</strong>/<strong>return value</strong> <em>or</em> any <strong>exception</strong> that occurred.  </li>
  </ul>
  
  <p>Given this, the <code>IParameterInspector</code> (with its <code>BeforeCall</code> and <code>AfterCall</code>) gives me <em>almost</em> everything I need.  The problem is that</p>
  
  <ul>
  <li>in the case of an exception, <code>AfterCall</code> is not called (see <a href="http://blogs.msdn.com/b/carlosfigueira/archive/2011/04/26/wcf-extensibility-iparameterinspector.aspx" rel="noreferrer">here</a>).  </li>
  </ul>
  
  <p>To help with that problem, I can add an <code>IClientMessageInspector</code> since its <code>AfterReceiveReply</code> does get called in the face of an exception.  This gives me the ability to</p>
  
  <ul>
  <li>determine if an exception (fault) occurred or not.</li>
  <li>do <strong>post</strong> work in the face of an exception</li>
  </ul>
  
  <p><strong>Question:</strong></p>
  
  <ul>
  <li>Is there a way with the <code>IClientMessageInspector.AfterReceiveReply</code> to get (or create the equivalent) <strong>exception</strong> that represents what will eventually be thrown to the callers.  And if so, is there a way to mark the exception as <strong>handled</strong> such that the callers will not get the exception?</li>
  <li>Or, is there some other extensibility mechanism or other approach I should be using to meet my goals?</li>
  </ul>