473,320 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

SOAP serialization exception

I have an app that uses the SOAP serializer to serialize and deserialize a
object of a certain class to a file. The class implements ISerializable.
From time to time it is necessary to add or remove fields from the class.
I've been able to deserialize out-of-date versions by handling serialization
exceptions in Sub New(ByVal info As SerializationInfo, ByVal context As
StreamingContext).

I've now hit a problem. With the latest version, if I try to deserialize an
out-of-date XML file I get an exception *before* my constructor starts to
run. Visual Studio reports:

A first chance exception of type
'System.Runtime.Serialization.SerializationExcepti on' occurred in
system.runtime.serialization.formatters.soap.dll
The message is: Top Object cannot be instantiated for element 'mListColor'.

mListColor is a field that no longer exists; however even if I do the
obvious thing and add it back, I still get the same error.

The serialization and deserialization works fine with newly serialized
files; it is just deserializing the old version that is not working.

How can I troubleshoot this?

Thanks for any advice,

Tim


Nov 21 '05 #1
1 2423
Does the type mListColor represents still exist as well? If not, then that
could be your problem as well. If that isn't it then please send a more
complete stack trace and a repro if possible.

Thanks.

Matt Tavis

Program Manager
XML Web Services
Microsoft Corporation

--------------------
From: "Tim Anderson" <ti*****@hotmail.com>
Subject: SOAP serialization exception
Date: Thu, 26 Aug 2004 15:38:17 +0100
Lines: 31
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <OQ*************@TK2MSFTNGP12.phx.gbl>
Newsgroups:
microsoft.public.dotnet.framework.webservices,micr osoft.public.dotnet.langua
ges.csharp
NNTP-Posting-Host: onlyconn.gotadsl.co.uk 82.133.123.179
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA02.phx.gbl!cpmsftn gxa06.phx.gbl!TK2MSFTNGP08
phx.gbl!TK2MSFTNGP12.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.languages.csharp:268249
microsoft.public.dotnet.framework.webservices:6370
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I have an app that uses the SOAP serializer to serialize and deserialize a
object of a certain class to a file. The class implements ISerializable.
From time to time it is necessary to add or remove fields from the class.
I've been able to deserialize out-of-date versions by handling serialization
exceptions in Sub New(ByVal info As SerializationInfo, ByVal context As
StreamingContext).

I've now hit a problem. With the latest version, if I try to deserialize an
out-of-date XML file I get an exception *before* my constructor starts to
run. Visual Studio reports:

A first chance exception of type
'System.Runtime.Serialization.SerializationExcepti on' occurred in
system.runtime.serialization.formatters.soap.dll
The message is: Top Object cannot be instantiated for element 'mListColor'.

mListColor is a field that no longer exists; however even if I do the
obvious thing and add it back, I still get the same error.

The serialization and deserialization works fine with newly serialized
files; it is just deserializing the old version that is not working.

How can I troubleshoot this?

Thanks for any advice,

Tim

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: craig | last post by:
Hi, I'm new to all this and having tremendous difficulty trying to deserialize the following: <soap-env:Envelope...
6
by: Tim Anderson | last post by:
I have an app that uses the SOAP serializer to serialize and deserialize a object of a certain class to a file. The class implements ISerializable. From time to time it is necessary to add or...
0
by: Cleo | last post by:
Hi, I am trying to call a WebService Method written in Weblogic from VB.NET and I am getting the following error. I am using SOAP Caal s from VB.NET. Please find the wsdl file and my code. ...
3
by: parrot toes | last post by:
Summary: I have been trying to make requests of a web service provided by Axis using a dotnet client with code generated by wsdl.exe and have been getting exceptions when trying to process the...
0
by: Matt Wood | last post by:
Hi, I have written a Web Service for a customer which expects a SOAP message with Document/Literal encoding, and uses RoutingStyle=SoapServiceRoutingStyle.RequestElement to route the SOAP body...
3
by: JRey | last post by:
Does .Net generate the classes for Faults when they are specified in the WSDL. I tried defining them and then generating a proxy, and it did not appear to do it. On the Java side it did generate...
0
by: GAURAV KRISHNA | last post by:
Hello, I'm trying to build a C# client to consume an AXIS Web Service (running SOAP over HTTP). The Web Service encodes full server-side exception traces in the Soap Fault > Detail element using...
0
by: Nol | last post by:
Hi all, My webservice throws an exception, which is translated into a soap Fault in the soap message body. See below for the actual message format as it is send by the server. On the (dotNet)...
4
by: Nol de Wit | last post by:
(this is a re-post of a message I've posted last friday, but now from my MSDN subscription account, hoping MSDN support will pick this up...) Hi all, My webservice throws an exception, which...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.