Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / June 2006

Tip: Looking for answers? Try searching our database.

Selialize exceptions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
YC - 27 Jun 2006 15:57 GMT
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öran Andersson - 27 Jun 2006 19:52 GMT
When an exception occurs in a web service, the exception object is
serialized when it's sent from the server to the client.

> Hi,
> I creating a custom exception and I'm implementing the best practice with a
[quoted text clipped - 7 lines]
>
> Yoav
YC - 28 Jun 2006 07:29 GMT
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?

> When an exception occurs in a web service, the exception object is
> serialized when it's sent from the server to the client.
[quoted text clipped - 10 lines]
> >
> > Yoav
Göran Andersson - 28 Jun 2006 08:05 GMT
Because your exception is stored as the inner exception in the soap
exception.

> Hi,
> Thanks for replying.
[quoted text clipped - 17 lines]
>>>
>>> Yoav
YC - 28 Jun 2006 08:19 GMT
I get null in the inner exception always.
Can you show me what mean please?
Thanks.

> Because your exception is stored as the inner exception in the soap
> exception.
[quoted text clipped - 20 lines]
> >>>
> >>> Yoav
Göran Andersson - 28 Jun 2006 21:41 GMT
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.

> I get null in the inner exception always.
> Can you show me what mean please?
[quoted text clipped - 24 lines]
>>>>>
>>>>> Yoav
Yoav - 29 Jun 2006 07:29 GMT
Hi Goran.
thanks for replying.
That my conclusion also.

^Thanks again.

> 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
[quoted text clipped - 33 lines]
> >>>>>
> >>>>> Yoav

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.