Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / June 2004

Tip: Looking for answers? Try searching our database.

when webservice service is down.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DotNetMania - 20 Jun 2004 10:12 GMT
i'm woking with webservice ...

how should the client do when webservice service is down.

what kind of exception would occur..?

when my testing it always wait server's signal...

best regards
Richard Thombs - 20 Jun 2004 17:19 GMT
> i'm woking with webservice ...
> how should the client do when webservice service is down.
> what kind of exception would occur..
> when my testing it always wait server's signal...

I think all the exceptions will be of class WebException. This class
gives you a bunch of information about just what went wrong, but it
isn't easy to get at it sometimes.

What I do is this:

public static string WebExceptionMessage(WebException ex)
{
    switch(ex.Status)
    {
        case WebExceptionStatus.ConnectFailure:
            return "Unable to connect to the Internet";

        case WebExceptionStatus.NameResolutionFailure:
            return "Unable to resolve the server's address";

        case WebExceptionStatus.Timeout:
            return "Timeout waiting for the server to respond"
    }

    if (ex.Response is HttpWebResponse)
    {
        HttpWebResponse response = (HttpWebResponse) ex.Response;
        if (response.StatusCode == HttpStatusCode.NotFound")
        {
            return "Web server contacted, but the web service was not found.";
        }
        else
        {
            return "Some other error happened";
        }
    }
}

R.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.