Selialize exceptions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I creating a custom exception and I'm implementing the best practice with a
constructor which is needed for serialization (with Serialization Info info,
StreamingContext context).
My question is - what’s the use for serializing exceptions when working with
web services as my remoting mechanism (for instance)? Why do I need to
provide my custom exception with a serializable option?

Thanks

Yoav
 
When an exception occurs in a web service, the exception object is
serialized when it's sent from the server to the client.
 
Hi,
Thanks for replying.
Yes, I know that a web service serializes an exception and throws a soap
exception to the client.
The question is - why should I make my own custom exception serialized when
the service anyway throws a soap exception?
 
I have implemented and tested a pair of exception classes as part of my
coding the last days, and I have realized that the soap exception
actually doesn't serialize and deserialize the inner exceptions. It just
flattens them and puts them in the message, so the soap exception
doesn't have any inner exception.

There are other cases where the exceptions really are serialized,
though, like when using remoting.
 
Back
Top