Selialize exceptions

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
 
G

Guest

When an exception occurs in a web service, the exception object is
serialized when it's sent from the server to the client.
 
G

Guest

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?
 
G

Guest

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top