app_offline.htm file being used to take webservice offline - possible to read contents of file?
<p>I'm using an app_offline.htm file as described here :  <a href="http://weblogs.asp.net/scottgu/archive/2005/10/06/426755.aspx" rel="nofollow">http://weblogs.asp.net/scottgu/archive/2005/10/06/426755.aspx</a> to take an old asmx web service offline. </p>

<p>All works fine, and the client end gets a HTTP 503 exception like : </p>

<pre><code>Exception : System.Net.WebException
The request failed with HTTP status 503: Service Unavailable.
Source : System.Web.Services
Stack trace :
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) 
</code></pre>

<p>My question : is it possible for the client application to read the contents of the app_offline.htm file which would have been returned ? The basic HTML in that file has helpful text like : "The application is currently undergoing maintenance". I can see the contents of this file being returned in the response using Fiddler. </p>

<p>It would be useful to be able to parse this html response to provide more info to the user. (i.e. so it is possible to distinguish between a 503 error due to system maintenance, and other 503s due to system being overloaded etc). </p>

<p><strong>EDIT</strong> : BluesRockAddict's response sounded good, but the stream seems to be unavailable at this time. e.g. :  </p>

<pre><code>            // wex is the caught System.Net.WebException 
            System.Net.WebResponse resp = wex.Response;


            byte[] buff =  new byte[512];
            Stream st = resp.GetResponseStream();

            int count = st.Read(buff, 0, 512);  
</code></pre>

<p>The last line above which attempts to read the stream gives : </p>

<pre><code>Exception : System.ObjectDisposedException
Cannot access a closed Stream.
Source : mscorlib
Stack trace :
   at System.IO.__Error.StreamIsClosed()
   at System.IO.MemoryStream.Read(Byte[] buffer, Int32 offset, Int32 count)
</code></pre>
