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 / ASP.NET / Web Services / December 2004

Tip: Looking for answers? Try searching our database.

SerializationException

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mekim - 20 Dec 2004 23:43 GMT
I am getting an unhandled exception on a webservice as listed below
and my quesiton is

How do I trap it to find where it's coming from since it seems to be outside
of the my code.

Thx in advance
Mekim

An unhandled exception of type
'System.Runtime.Serialization.SerializationException' occurred in Unknown
Module.

Additional information: The type System.Web.Services.Protocols.SoapException
in Assembly System.Web.Services, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a is not marked as serializable
Dan Rogers - 20 Dec 2004 23:49 GMT
Hi,

It looks to me like someone has not tested their exception logic, and the
exception they are trying to throw is not compatible with the exception
mechanism.

To track this down, you need to be able to get to the source for the
service - so if this is not under your control I would imagine the best you
can do is to work with the party who does and treat this like a bug in a
vendors application.  

Best of luck

Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: SerializationException
thread-index: AcTm7axWWi0oTzWmTGaKXYEFM16RyQ==
X-WBNR-Posting-Host: 68.157.85.195
From: "=?Utf-8?B?bWVraW0=?=" <mekim@discussions.microsoft.com>
Subject: SerializationException
Date: Mon, 20 Dec 2004 15:43:14 -0800
Lines: 18
Message-ID: <B3FA0939-4426-4D41-A7F8-37FC3F815408@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
    charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:8228
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I am getting an unhandled exception on a webservice as listed below
and my quesiton is

How do I trap it to find where it's coming from since it seems to be
outside
of the my code.

Thx in advance
Mekim

An unhandled exception of type
'System.Runtime.Serialization.SerializationException' occurred in Unknown
Module.

Additional information: The type
System.Web.Services.Protocols.SoapException
in Assembly System.Web.Services, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a is not marked as serializable
mekim - 21 Dec 2004 00:23 GMT
Hi Dan,

that's the confusing part...It's my project...my source code

The error happens within the soap call mechinism

Regards,
Mekim

> Hi,
>
[quoted text clipped - 54 lines]
> in Assembly System.Web.Services, Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=b03f5f7f11d50a3a is not marked as serializable
Dan Rogers - 21 Dec 2004 18:47 GMT
Hi Mekim,

No, the error is the the result of a bug in your code - 99.999 percent
certain.  WIthout knowing what class you are trying to serialize (in your
service code) it's really hard to say where the bug is occurring.

Try placing a break point in your service code, load the project in VS and
then click debug/start, and then call the service from your test client.  
Step thru the service method a line at a time and note what line it is on
where it raises an exception.  The line it does this on is very likely to
contain the mistake.  

Serializing a type that isn't serializable often occurs when you have
assumed that any class in the .NET Framework can readily be serialized out
to XML.  There are very FEW framework classes that serialize with good
effect outside of the core data types.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: SerializationException
thread-index: AcTm8z0h6pf/NUsbQxOCk+RY4CV1Ww==
X-WBNR-Posting-Host: 68.157.85.195
From: "=?Utf-8?B?bWVraW0=?=" <mekim@discussions.microsoft.com>
References:  <B3FA0939-4426-4D41-A7F8-37FC3F815408@microsoft.com>
<luMj25u5EHA.1512@cpmsftngxa10.phx.gbl>
Subject: RE: SerializationException
Date: Mon, 20 Dec 2004 16:23:05 -0800
Lines: 72
Message-ID: <43B3B349-7425-4B1E-B572-7B137F65EEEA@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
    charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:8232
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Hi Dan,

that's the confusing part...It's my project...my source code

The error happens within the soap call mechinism

Regards,
Mekim

"Dan Rogers" wrote:

> Hi,
>
[quoted text clipped - 54 lines]
> in Assembly System.Web.Services, Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=b03f5f7f11d50a3a is not marked as serializable
erymuzuan - 21 Dec 2004 15:37 GMT
are you trying to Serialized (i.e. tranferring the exception across the
wire) if so then you mignt want to check out the advanced serialization
mechanism for Exception using XML friendly base64 , bear in mind this is
strictly for .net client and WS, so it's not interop friedly

[Serializable]
public class MySoapException
{

    [XmlIgnore]
    public Exception Exception;
    public MySoapException()
    {
        //Required by XML serialization
    }

    public MySoapException(Exception Exception)
    {
        this.Exception = Exception;
    }
        public string ExeptionDetail{
        get{
            MemoryStream ms = new MemoryStream();
            BinaryFormatter bf = new BinaryFormatter();
            bf.Serialize(ms, this.Exception);
            ms.Close();
            return Convert.ToBase64String(ms.ToArray());
        }
        set{
            MemoryStream ms = new MemoryStream(
                Convert.FromBase64String(value));
            BinaryFormatter bf = new BinaryFormatter();
            this.Exception = (Exception)bf.Deserialize(ms);
            ms.Close();
        }
    }
        public MySoapException(string ExeptionDetail){
        this.ExeptionDetail = ExeptionDetail;
    }
}

> I am getting an unhandled exception on a webservice as listed below
> and my quesiton is
[quoted text clipped - 12 lines]
> in Assembly System.Web.Services, Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=b03f5f7f11d50a3a is not marked as serializable

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.