title: Exceptions from SoapHttpClientProtocol.Invoke Method .NET web service
body: <p>I am calling a web service from a C# forms based app.</p>
  
  <pre><code>ServReturnType obj = ServProxyClass(int i, int k);
  </code></pre>
  
  <p>I have the potential to get back an exception. The exception could be that the service didn't connect at all, that there was a failure on the receive, but the original message went, or anything in between. I then need to make a decision based on the exception thrown, either on the type, or the message, or both, as to do one of two actions next. </p>
  
  <pre><code>try
  {    
       ServReturnType obj = ServProxyClass(int i, int k);
  }
  catch (WebException ex)
  {
       DoAction1();
  }
  catch(SocketException ex)
  {
       DoAction2();
  }
  catch(SoapException ex)
  {
       DoAction1()
  }
  </code></pre>
  
  <p>The issues is, my choice of subsequent actions depends on whether or not the first call made it to the server before failing. How can I find a list of all possible exceptions thrown, and what they might mean, as this is all code in the framework. I looked that MSDN docs, and saw that SoapHttpClientProtocol.Invoke can throw a SoapException, however there are methods called by this method that bubble up System.Net.WebExceptions. So I need a list of the whole call stack and what it can throw, and what that means.</p>
  
  <p>Any ideas?</p>
  
  <p><strong>Update 1</strong></p>
  
  <p>Darin, your answer more or less confirms my suspicions that what I want doesn't really make sense. I have opted to do more detective work first, then use that to decide what to do next. Unfortunately in this case, since we are processing credit cards, it really matters what exactly has happened, and whether or not we sent data.</p>