SerializationException

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mekim

    SerializationException

    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. SerializationEx ception' occurred in Unknown
    Module.

    Additional information: The type System.Web.Serv ices.Protocols. SoapException
    in Assembly System.Web.Serv ices, Version=1.0.500 0.0, Culture=neutral ,
    PublicKeyToken= b03f5f7f11d50a3 a is not marked as serializable


  • Dan Rogers

    #2
    RE: SerializationEx ception

    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: SerializationEx ception
    thread-index: AcTm7axWWi0oTzW mTGaKXYEFM16RyQ ==
    X-WBNR-Posting-Host: 68.157.85.195
    From: "=?Utf-8?B?bWVraW0=?=" <mekim@discussi ons.microsoft.c om>
    Subject: SerializationEx ception
    Date: Mon, 20 Dec 2004 15:43:14 -0800
    Lines: 18
    Message-ID: <B3FA0939-4426-4D41-A7F8-37FC3F815408@mi crosoft.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.publi c.dotnet.framew ork.webservices
    NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.1.29
    Path: cpmsftngxa10.ph x.gbl!TK2MSFTNG XA03.phx.gbl
    Xref: cpmsftngxa10.ph x.gbl
    microsoft.publi c.dotnet.framew ork.webservices :8228
    X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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. SerializationEx ception' occurred in Unknown
    Module.

    Additional information: The type
    System.Web.Serv ices.Protocols. SoapException
    in Assembly System.Web.Serv ices, Version=1.0.500 0.0, Culture=neutral ,
    PublicKeyToken= b03f5f7f11d50a3 a is not marked as serializable



    Comment

    • mekim

      #3
      RE: SerializationEx ception

      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:
      [color=blue]
      > 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: SerializationEx ception
      > thread-index: AcTm7axWWi0oTzW mTGaKXYEFM16RyQ ==
      > X-WBNR-Posting-Host: 68.157.85.195
      > From: "=?Utf-8?B?bWVraW0=?=" <mekim@discussi ons.microsoft.c om>
      > Subject: SerializationEx ception
      > Date: Mon, 20 Dec 2004 15:43:14 -0800
      > Lines: 18
      > Message-ID: <B3FA0939-4426-4D41-A7F8-37FC3F815408@mi crosoft.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.publi c.dotnet.framew ork.webservices
      > NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.1.29
      > Path: cpmsftngxa10.ph x.gbl!TK2MSFTNG XA03.phx.gbl
      > Xref: cpmsftngxa10.ph x.gbl
      > microsoft.publi c.dotnet.framew ork.webservices :8228
      > X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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. SerializationEx ception' occurred in Unknown
      > Module.
      >
      > Additional information: The type
      > System.Web.Serv ices.Protocols. SoapException
      > in Assembly System.Web.Serv ices, Version=1.0.500 0.0, Culture=neutral ,
      > PublicKeyToken= b03f5f7f11d50a3 a is not marked as serializable
      >
      >
      >[/color]

      Comment

      • erymuzuan

        #4
        Re: SerializationEx ception

        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.ToBase6 4String(ms.ToAr ray());
        }
        set{
        MemoryStream ms = new MemoryStream(
        Convert.FromBas e64String(value ));
        BinaryFormatter bf = new BinaryFormatter ();
        this.Exception = (Exception)bf.D eserialize(ms);
        ms.Close();
        }
        }
        public MySoapException (string ExeptionDetail) {
        this.ExeptionDe tail = ExeptionDetail;
        }
        }



        mekim wrote:[color=blue]
        > 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. SerializationEx ception' occurred in Unknown
        > Module.
        >
        > Additional information: The type System.Web.Serv ices.Protocols. SoapException
        > in Assembly System.Web.Serv ices, Version=1.0.500 0.0, Culture=neutral ,
        > PublicKeyToken= b03f5f7f11d50a3 a is not marked as serializable
        >
        >[/color]

        Comment

        • Dan Rogers

          #5
          RE: SerializationEx ception

          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: SerializationEx ception
          thread-index: AcTm8z0h6pf/NUsbQxOCk+RY4CV 1Ww==
          X-WBNR-Posting-Host: 68.157.85.195
          From: "=?Utf-8?B?bWVraW0=?=" <mekim@discussi ons.microsoft.c om>
          References: <B3FA0939-4426-4D41-A7F8-37FC3F815408@mi crosoft.com>
          <luMj25u5EHA.15 12@cpmsftngxa10 .phx.gbl>
          Subject: RE: SerializationEx ception
          Date: Mon, 20 Dec 2004 16:23:05 -0800
          Lines: 72
          Message-ID: <43B3B349-7425-4B1E-B572-7B137F65EEEA@mi crosoft.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.publi c.dotnet.framew ork.webservices
          NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.1.29
          Path: cpmsftngxa10.ph x.gbl!TK2MSFTNG XA03.phx.gbl
          Xref: cpmsftngxa10.ph x.gbl
          microsoft.publi c.dotnet.framew ork.webservices :8232
          X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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:
          [color=blue]
          > 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[/color]
          you[color=blue]
          > 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: SerializationEx ception
          > thread-index: AcTm7axWWi0oTzW mTGaKXYEFM16RyQ ==
          > X-WBNR-Posting-Host: 68.157.85.195
          > From: "=?Utf-8?B?bWVraW0=?=" <mekim@discussi ons.microsoft.c om>
          > Subject: SerializationEx ception
          > Date: Mon, 20 Dec 2004 15:43:14 -0800
          > Lines: 18
          > Message-ID: <B3FA0939-4426-4D41-A7F8-37FC3F815408@mi crosoft.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.publi c.dotnet.framew ork.webservices
          > NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.1.29
          > Path: cpmsftngxa10.ph x.gbl!TK2MSFTNG XA03.phx.gbl
          > Xref: cpmsftngxa10.ph x.gbl
          > microsoft.publi c.dotnet.framew ork.webservices :8228
          > X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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. SerializationEx ception' occurred in Unknown
          > Module.
          >
          > Additional information: The type
          > System.Web.Serv ices.Protocols. SoapException
          > in Assembly System.Web.Serv ices, Version=1.0.500 0.0, Culture=neutral ,
          > PublicKeyToken= b03f5f7f11d50a3 a is not marked as serializable
          >
          >
          >[/color]

          Comment

          Working...