M
Matt Bush
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, eg. properties such as 'TargetSite' can not be serialised.
Do I need to do imperative asserts or explicit demands or both. If so could
you give me a code example that relaxes the security on xml serializing a
custom exception.
Thanks.
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, eg. properties such as 'TargetSite' can not be serialised.
Do I need to do imperative asserts or explicit demands or both. If so could
you give me a code example that relaxes the security on xml serializing a
custom exception.
Thanks.