Professional Web Applications Themes

Exception handling question - ASP.NET Web Services

Hi there, I have an ASP.NET web site and service. The site calls methods from the web-service. Whenever a service call throws an exception, I'd like to get the exception message. However, at the client, the message contains the class name and stack trace of the exception, and is encapsulated in a SoapException message, e.g. ....SoapException: ....MyException: The Actual Message at \n stack trace The InnerException property is always null (even when throwing a SoapException with embedded exception at the service). How do I get to the exception message? Any help appreciated, Thanks, Michel...

  1. #1

    Default Exception handling question

    Hi there,

    I have an ASP.NET web site and service. The site calls methods from the
    web-service.
    Whenever a service call throws an exception, I'd like to get the exception
    message.
    However, at the client, the message contains the class name and stack trace
    of the exception, and is encapsulated in a SoapException message, e.g.

    ....SoapException: ....MyException: The Actual Message at \n stack trace

    The InnerException property is always null (even when throwing a
    SoapException with embedded exception at the service).

    How do I get to the exception message?

    Any help appreciated,
    Thanks,
    Michel


    Michel Guest

  2. #2

    Default Re: Exception handling question

    Check out following article that handles this problem:
    [url]http://www.microsoft.com/belux/nl/msdn/community/columns/jtielens/soapexcept[/url]
    ions.mspx

    Sometimes things can go wrong when code is executed, so Exceptions are
    thrown. When your application exposes services through a webservice layer,
    SoapExceptions are thrown from the server to the client. By default normal
    Exceptions are converted to a SoapException, resulting in a rather ugly
    Exception containing all information concatenated in a long String. But
    luckily the SOAP protocol allows any XML doent to be included in SOAP
    error messages. This article shows how to build some helper classes to
    easily pass error information from the server to the client through a
    webservice layer.


    --
    Greetz

    Jan Tielens
    ________________________________
    Read my weblog: [url]http://weblogs.asp.net/jan[/url]


    "Michel" <msmvirtualsciences.nl> wrote in message
    news:brmkc1$8q0$1reader08.wxs.nl...
    > Hi there,
    >
    > I have an ASP.NET web site and service. The site calls methods from the
    > web-service.
    > Whenever a service call throws an exception, I'd like to get the exception
    > message.
    > However, at the client, the message contains the class name and stack
    trace
    > of the exception, and is encapsulated in a SoapException message, e.g.
    >
    > ...SoapException: ....MyException: The Actual Message at \n stack trace
    >
    > The InnerException property is always null (even when throwing a
    > SoapException with embedded exception at the service).
    >
    > How do I get to the exception message?
    >
    > Any help appreciated,
    > Thanks,
    > Michel
    >
    >

    Jan Tielens Guest

  3. #3

    Default Re: Exception handling question

    Hi Jan (ook Hollandse kaasboer toevallig),

    I've briefly read the article and related articles.
    This is what I need.

    Thanks a lot,
    Michel

    "Jan Tielens" <janno.spam.please.leadit.be> wrote in message
    news:eJ4HK39wDHA.3216TK2MSFTNGP11.phx.gbl...
    > Check out following article that handles this problem:
    >
    [url]http://www.microsoft.com/belux/nl/msdn/community/columns/jtielens/soapexcept[/url]
    > ions.mspx
    >
    > Sometimes things can go wrong when code is executed, so Exceptions are
    > thrown. When your application exposes services through a webservice layer,
    > SoapExceptions are thrown from the server to the client. By default normal
    > Exceptions are converted to a SoapException, resulting in a rather ugly
    > Exception containing all information concatenated in a long String. But
    > luckily the SOAP protocol allows any XML doent to be included in SOAP
    > error messages. This article shows how to build some helper classes to
    > easily pass error information from the server to the client through a
    > webservice layer.
    >
    >
    > --
    > Greetz
    >
    > Jan Tielens
    > ________________________________
    > Read my weblog: [url]http://weblogs.asp.net/jan[/url]
    >
    >
    > "Michel" <msmvirtualsciences.nl> wrote in message
    > news:brmkc1$8q0$1reader08.wxs.nl...
    > > Hi there,
    > >
    > > I have an ASP.NET web site and service. The site calls methods from the
    > > web-service.
    > > Whenever a service call throws an exception, I'd like to get the
    exception
    > > message.
    > > However, at the client, the message contains the class name and stack
    > trace
    > > of the exception, and is encapsulated in a SoapException message, e.g.
    > >
    > > ...SoapException: ....MyException: The Actual Message at \n stack trace
    > >
    > > The InnerException property is always null (even when throwing a
    > > SoapException with embedded exception at the service).
    > >
    > > How do I get to the exception message?
    > >
    > > Any help appreciated,
    > > Thanks,
    > > Michel
    > >
    > >
    >
    >

    Michel Guest

  4. #4

    Default Re: Exception handling question

    Nope, Belgian .NET guy :-P

    --
    Greetz

    Jan Tielens
    ________________________________
    Read my weblog: [url]http://weblogs.asp.net/jan[/url]


    "Michel" <msmvirtualsciences.nl> wrote in message
    news:brn66a$g7u$1reader08.wxs.nl...
    > Hi Jan (ook Hollandse kaasboer toevallig),
    >
    > I've briefly read the article and related articles.
    > This is what I need.
    >
    > Thanks a lot,
    > Michel
    >
    > "Jan Tielens" <janno.spam.please.leadit.be> wrote in message
    > news:eJ4HK39wDHA.3216TK2MSFTNGP11.phx.gbl...
    > > Check out following article that handles this problem:
    > >
    >
    [url]http://www.microsoft.com/belux/nl/msdn/community/columns/jtielens/soapexcept[/url]
    > > ions.mspx
    > >
    > > Sometimes things can go wrong when code is executed, so Exceptions are
    > > thrown. When your application exposes services through a webservice
    layer,
    > > SoapExceptions are thrown from the server to the client. By default
    normal
    > > Exceptions are converted to a SoapException, resulting in a rather ugly
    > > Exception containing all information concatenated in a long String. But
    > > luckily the SOAP protocol allows any XML doent to be included in SOAP
    > > error messages. This article shows how to build some helper classes to
    > > easily pass error information from the server to the client through a
    > > webservice layer.
    > >
    > >
    > > --
    > > Greetz
    > >
    > > Jan Tielens
    > > ________________________________
    > > Read my weblog: [url]http://weblogs.asp.net/jan[/url]
    > >
    > >
    > > "Michel" <msmvirtualsciences.nl> wrote in message
    > > news:brmkc1$8q0$1reader08.wxs.nl...
    > > > Hi there,
    > > >
    > > > I have an ASP.NET web site and service. The site calls methods from
    the
    > > > web-service.
    > > > Whenever a service call throws an exception, I'd like to get the
    > exception
    > > > message.
    > > > However, at the client, the message contains the class name and stack
    > > trace
    > > > of the exception, and is encapsulated in a SoapException message, e.g.
    > > >
    > > > ...SoapException: ....MyException: The Actual Message at \n stack
    trace
    > > >
    > > > The InnerException property is always null (even when throwing a
    > > > SoapException with embedded exception at the service).
    > > >
    > > > How do I get to the exception message?
    > > >
    > > > Any help appreciated,
    > > > Thanks,
    > > > Michel
    > > >
    > > >
    > >
    > >
    >
    >

    Jan Tielens Guest

Similar Threads

  1. Handling error with exception
    By Hari Fajri in forum PERL Beginners
    Replies: 2
    Last Post: February 13th, 02:33 PM
  2. PHP, MySQL and exception handling
    By OneSolution in forum PHP Development
    Replies: 2
    Last Post: November 20th, 04:47 AM
  3. Replies: 0
    Last Post: July 29th, 05:39 PM
  4. Exception Handling.
    By Rajeev Soni in forum ASP.NET General
    Replies: 2
    Last Post: July 18th, 05:46 PM
  5. Exception handling problem
    By Alex in forum ASP.NET General
    Replies: 0
    Last Post: July 17th, 10:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139