Page view counter

Soap exceptions

Last post 07-05-2005 8:34 AM by joteke. 5 replies.

Sort Posts:

  • Soap exceptions

    07-02-2005, 1:00 AM
    • Loading...
    • nissan
    • Joined on 05-10-2005, 4:32 PM
    • Posts 257
    • Points 911
    Guys,
    I wrote a web service. In the web method i have reportingServices.Render() method. What kind of exceptions can i catch & how do I catch them. Please help me get going.
    catch(SoapException e)
    {
         Console.WriteLine(e.Detail()
    }
    Is this ok. Please give me clues. Thank you so much.
  • Re: Soap exceptions

    07-02-2005, 1:49 AM
    • Loading...
    • joteke
    • Joined on 06-16-2002, 3:24 PM
    • Kyro, Finland
    • Posts 6,874
    • Points 45,946
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs
    Hi,

    as long as you keep inside the web method, you can handle any exception means that all which your application (web service can raise), basically all deriving from System.Exception. Key point in soap exceptions is that if your web service raises any exception, it is kind of converted or "marshalled" to SoapException so that client/usder can be informed about the
    error.

    So it means that if you handle exceptions at the client, you'd try to handle SoapException.

    Thanks,

    Teemu Keiski
    Finland, EU
  • Re: Soap exceptions

    07-03-2005, 10:55 AM
    • Loading...
    • nissan
    • Joined on 05-10-2005, 4:32 PM
    • Posts 257
    • Points 911

    Hi,
    Thanks, for the reply. When i say Console.writeline in the webmethod.,where is the exception shown. I copied this from a website. So, iam not really sure where is the exception raised. Is it ok to write Console.write in a webmethod?

     

  • Re: Soap exceptions

    07-04-2005, 1:45 AM
    • Loading...
    • joteke
    • Joined on 06-16-2002, 3:24 PM
    • Kyro, Finland
    • Posts 6,874
    • Points 45,946
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs
    Well, it would write to a Console when you'd debug this in VS.NET etc, but in normal production use you'd use some sort of logging system. For example log errors to a database or a log file on the server.
    Thanks,

    Teemu Keiski
    Finland, EU
  • Re: Soap exceptions

    07-04-2005, 7:41 PM
    • Loading...
    • nissan
    • Joined on 05-10-2005, 4:32 PM
    • Posts 257
    • Points 911
    Could you refer me to a good website which explains more about this. Thank you so much.
  • Re: Soap exceptions

    07-05-2005, 8:34 AM
    • Loading...
    • joteke
    • Joined on 06-16-2002, 3:24 PM
    • Kyro, Finland
    • Posts 6,874
    • Points 45,946
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs
    Hello,

    generally about web services
    http://aspnet.4guysfromrolla.com/articles/100803-1.aspx

    (One big free article serie by Scott Mitchell)

    Here is a few articles about error handling in web services
    http://west-wind.com/weblog/posts/1393.aspx
    http://www.codeproject.com/aspnet/ASPNETExceptionHandling.asp


    Thanks,

    Teemu Keiski
    Finland, EU
Page 1 of 1 (6 items)