title: How can I get the message/response body in WCF when server returns an HTTP 401?
body: <p>I have a WCF client test harness where I'm using a "client message inspector" endpoint behavior to "pick off" raw requests and response messages going to and from a service and save them for later display in the UI.</p>
  
  <p>This works great, except for the use case where invalid credentials are passed (Basic Authentication). The server returns an HTTP 401 along with a SOAP fault in the body containing details of what happened. I have no control over the service, so this behavior cannot be changed.</p>
  
  <p>Because the HTTP 401 is returned as a <code>WebException</code>, my message inspector never fires and I can't get to the raw response.  This exception eventually gets to the UI in the form a <code>MessageSecurityException</code>.</p>
  
  <p>Is there any way to suppress this so the message inspector's <code>AfterReceiveReply</code> still fires? or is there somewhere else I can access the entire raw response?</p>
  
  <p>Thanks!</p>