|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Selialize exceptionsHi,
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. YC wrote: Show quoteHide quote > 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 > 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? Show quoteHide quote "Göran Andersson" wrote: > When an exception occurs in a web service, the exception object is > serialized when it's sent from the server to the client. > > YC wrote: > > 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 > > > Because your exception is stored as the inner exception in the soap
exception. YC wrote: Show quoteHide quote > 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öran Andersson" wrote: > >> When an exception occurs in a web service, the exception object is >> serialized when it's sent from the server to the client. >> >> YC wrote: >>> 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 >>> I get null in the inner exception always.
Can you show me what mean please? Thanks. Show quoteHide quote "Göran Andersson" wrote: > Because your exception is stored as the inner exception in the soap > exception. > > YC wrote: > > 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öran Andersson" wrote: > > > >> When an exception occurs in a web service, the exception object is > >> serialized when it's sent from the server to the client. > >> > >> YC wrote: > >>> 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 > >>> > 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. YC wrote: Show quoteHide quote > I get null in the inner exception always. > Can you show me what mean please? > Thanks. > > "Göran Andersson" wrote: > >> Because your exception is stored as the inner exception in the soap >> exception. >> >> YC wrote: >>> 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öran Andersson" wrote: >>> >>>> When an exception occurs in a web service, the exception object is >>>> serialized when it's sent from the server to the client. >>>> >>>> YC wrote: >>>>> 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 >>>>> Hi Goran.
thanks for replying. That my conclusion also. ^Thanks again. Show quoteHide quote "Göran Andersson" wrote: > 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. > > YC wrote: > > I get null in the inner exception always. > > Can you show me what mean please? > > Thanks. > > > > "Göran Andersson" wrote: > > > >> Because your exception is stored as the inner exception in the soap > >> exception. > >> > >> YC wrote: > >>> 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öran Andersson" wrote: > >>> > >>>> When an exception occurs in a web service, the exception object is > >>>> serialized when it's sent from the server to the client. > >>>> > >>>> YC wrote: > >>>>> 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 > >>>>> >
Other interesting topics
NOT using the System.Threadpool in server class applications
XML merging DataGridView Reference of Available Metadata Attributes Is this possible?!?!?!? compile-time error generating custom attributes convert datetime to sortable format CHM file with .NET Programmatically Install Certificate into Windows Certificate Store Create my own designer |
|||||||||||||||||||||||