473,624 Members | 2,027 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SoapFormatter throws System.Exceptio n when deserializing non-compatible versions

Given:

public class MyClass{
public String MyPropertyOne;
}

I have a soap document created by serializing an instance of a previous
version of MyClass. However, now MyClass looks like:

public class MyClass{
public String MyPropertyOne;
public String MyPropertyTwo;
}

If I now use the SoapFormatter to deserialize the older instance of MyClass,
I get an exception that looks like:

"Wrong number of Members. Object MyClass has 2 members, number of members
deserialized is 1"

I would like the older instance to continue deserializing, even though it
might not be "binary compatible". Is there an easy way to do this?

TIA//


Nov 19 '05 #1
0 1259

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

Similar topics

0
2076
by: Philip Reed | last post by:
I'm trying to write a preferences-handling infrastructure that serializes prefs to XML. Basically I want to read in a common "default" prefs set, then read in the user's prefs and override the defaults as appropriate. I'm trying to do them both using the SoapFormatter to serialize. But when I try to read in the user's prefs after reading the defaults, both from similar Soap files, I get this exception: ----...
1
2281
by: Philip K | last post by:
I was trying to use Soap serialisation to save some systems settings how ever it fails if the settings contain a Font object, works fine if the Font object is not in the object being serialised. Font is marked in the MS documentation. Exception has been thrown by the target of an invocation. at System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context)
0
1439
by: craig | last post by:
Hi, I'm new to all this and having tremendous difficulty trying to deserialize the following: <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:Header><TransactionID xmlns="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-0" soap-env:mustUnderstand="1">-1433961100312413552</TransactionID></soap-env:Header><soap-env:Body><SubmitReq
1
2680
by: Jim S | last post by:
I have an application where I have to make a tree of objects. To do this, I have my own node class. At certain points in the application, I need to save data. I am having a problem with the SoapFormatter. The following program gets the exception: "The data at the root level is invalid. Line 55, position -460." This code works fine if I use a BinaryFormatter instead of a SoapFormatter. Any ideas? Here is a test program:
2
3757
by: Phillip Galey | last post by:
I have an object called Place which contains only string properties and has the <Serializable()> flag before the class name declaration. I also have a collection object called Places, which is implemented using Inherits System.Collections.Specialized.NameObjectCollectionBase and also has the <Serializable()> flag before the class name declaration. In the calling code, I'm successfully serializing the object to an XML file using a...
0
1096
by: GrandpaB | last post by:
I have an error that I have not been able to find. Any insight you can offer would be most appreciated. I believe that the problem is associated with the SoapFormatter. The application allows the user to document a collection of art objects. Each object is stored in an arrayList as an objArt. To simplify finding my problem, I have eliminated all the code except the code for six buttons, the Title and Description textboxes and the...
4
10168
by: laplas | last post by:
Hello, what is the internal difference between them in FW 2.0? I'm trying to serialize SqlConnectionInfo from SQL SMO and Soap works just fine but XML throws an exception SqlConnectionInfo has SerializableAttribute attribute ????
0
1085
by: Clas | last post by:
Hi! I have some questions about exceptionshandling when using webservices. I want to be able to get the original exception back from the webservice-soapexception. I have used the SoapFormatter to serialize my exceptions before throwing them from the webservice-layer to the client. At the client I´m deserializing them and getting the original exception back. This works great! However, in Framework 2.0 the SoapFormatter no longer exists....
3
3989
by: Wiebe Tijsma | last post by:
Hi, I'm trying to serialize a KeyedCollection with the SoapFormatter, however I'm getting the exception: System.Runtime.Serialization.SerializationException: Soap Serializer does not support serializing Generic Types : System.Collections.Generic.GenericEqualityComparer`1 I didn't expose any generic types however, so it's internal to the Keyed
0
1101
by: Alphamacaroon | last post by:
All, I am using the SoapFormatter class to parse/deserialize SOAP/RPC calls from a remote client. The SoapFormatter works like a charm when the message contains simple parameter types (like strings, ints, bools, etc), but it throws an error when the message contains any sort of an array. For example, the incoming SOAP message might look like:
0
8173
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8679
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5563
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4079
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2606
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.