Serializing custom exception through a webmethod call.

Discussion in 'ASP .Net Web Services' started by Matt, Nov 2, 2004.

  1. Matt

    Matt Guest

    How do I xml serialize a custom exception so it can be included as a
    parameter on my webmethod? See extra details below.

    I have an audit web service which attempts to log exceptions to a database.

    The web method looks like:

    <WebMethod(Description:="Log process message.")> _
    Public Function AddProcessMessage( _
    ByVal ProcessExecutionKey As Long, _
    ByVal AppEx As UserException) As Boolean

    ' Returns true if successfully logs the message and the AppEx log
    flag will also be set to true.
    Return ProcessExecution.AddProcessMessage(ProcessExecutionKey, AppEx )
    End Function

    This generates an error complaining about security permissions on the base
    exception class 'TargetSite' property.
     
    Matt, Nov 2, 2004
    #1
    1. Advertising

  2. Matt

    Matt Guest

    I seem to have slipped through the gaps ...

    Could anyone answer this question????

    "Matt" wrote:

    > How do I xml serialize a custom exception so it can be included as a
    > parameter on my webmethod? See extra details below.
    >
    > I have an audit web service which attempts to log exceptions to a database.
    >
    > The web method looks like:
    >
    > <WebMethod(Description:="Log process message.")> _
    > Public Function AddProcessMessage( _
    > ByVal ProcessExecutionKey As Long, _
    > ByVal AppEx As UserException) As Boolean
    >
    > ' Returns true if successfully logs the message and the AppEx log
    > flag will also be set to true.
    > Return ProcessExecution.AddProcessMessage(ProcessExecutionKey, AppEx )
    > End Function
    >
    > This generates an error complaining about security permissions on the base
    > exception class 'TargetSite' property.
     
    Matt, Nov 7, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Strange Exception with WebMethod

    Kevin Spencer, Oct 25, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    426
    Kevin Spencer
    Oct 28, 2004
  2. germ
    Replies:
    0
    Views:
    1,294
  3. Hendrik Maryns
    Replies:
    2
    Views:
    336
    John B. Matthews
    Dec 2, 2008
  4. Tobias Lekman

    Returning Enumeration or Exception from WebMethod?

    Tobias Lekman, Aug 9, 2003, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    160
    Marina
    Aug 11, 2003
  5. Matt Bush

    Serializing custom exception through a webmethod call.

    Matt Bush, Nov 9, 2004, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    215
    Dan Rogers
    Nov 11, 2004
Loading...

Share This Page