Home All Groups Group Topic Archive Search About

Selialize exceptions

Author
27 Jun 2006 2:57 PM
YC
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

Author
27 Jun 2006 6:52 PM
Göran Andersson
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
>
Are all your drivers up to date? click for free checkup

Author
28 Jun 2006 6:29 AM
YC
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
> >
>
Author
28 Jun 2006 7:05 AM
Göran Andersson
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
>>>
Author
28 Jun 2006 7:19 AM
YC
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
> >>>
>
Author
28 Jun 2006 8:41 PM
Göran Andersson
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
>>>>>
Author
29 Jun 2006 6:29 AM
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
> >>>>>
>

Bookmark and Share