473,836 Members | 1,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SoapFormatter to XmlSerializer conversion

We currently persist our objects to xml/soap files using a SoapFormatter.
We control the serialization and de-serialization by implementing the
ISerializable and its two interface methods, namely, GetObjectData and a
constructor that takes two arguments (a SerializationIn fo object and a
StreamingContex t object).

It appears with the release of .net 2.0 that support for the SoapFormatter
is 'frozen' and that the direction we should take is to convert over to
using XmlSerializer. But it doesn't seem that the XmlSerializer has a
similar mechanism for controlling the serialization process. Instead, it
seems that attributes must now be placed on properties and fields to control
the serialization process. Given the large number of different object types
we persist, this will be a daunting task. And I haven't found any
documentation about some migration path.

Any direction or help on how to get from SoapFormatter to XmlSerializer
would really help.

Paul

Nov 12 '05 #1
2 2166
Hi Paul,

It seems the usage of SoaFormatter and ISerialize is the same as in .NET
1.1. However, the SoapFormatter does not support serialization
compatibility between versions of the .NET Framework. Serialization between
versions 1.1 and 2.0 types in the Framework often fails. You can check the
following links for more informatioin.

http://msdn2.microsoft.com/en-us/lib...us,VS.80).aspx

http://msdn2.microsoft.com/en-us/lib...ization.iseria
lizable

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #2
Don't know if this will help, but XmlSerializatio n (via the XmlSerializer)
has a similar mechanism to control serialization that .NET Serialization
does. There is an interface called IXmlSerializabl e. It's undocumented in
..NET 1.0 & 1.1 but exposed in .NET 2.0. You can search the web and find
articles on how to implement IXmlSerializabl e to control the serialization.
--
Thanks,
Nick
"Paul" wrote:
We currently persist our objects to xml/soap files using a SoapFormatter.
We control the serialization and de-serialization by implementing the
ISerializable and its two interface methods, namely, GetObjectData and a
constructor that takes two arguments (a SerializationIn fo object and a
StreamingContex t object).

It appears with the release of .net 2.0 that support for the SoapFormatter
is 'frozen' and that the direction we should take is to convert over to
using XmlSerializer. But it doesn't seem that the XmlSerializer has a
similar mechanism for controlling the serialization process. Instead, it
seems that attributes must now be placed on properties and fields to control
the serialization process. Given the large number of different object types
we persist, this will be a daunting task. And I haven't found any
documentation about some migration path.

Any direction or help on how to get from SoapFormatter to XmlSerializer
would really help.

Paul

Nov 17 '05 #3

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

Similar topics

1
1447
by: James Willock | last post by:
Hi, I have a class derived from ApplicationException as below (excuse formatting): public class MyException : ApplicationException { public string CompanyName { get {return Application.CompanyName;}
2
4735
by: Wiktor Zychla | last post by:
After signing all my assemblies with strong keys, I've found that the application refuses to deserialize any SOAP serialized data. The message says: Parse error, no assembly associated with the Xml key. and refers to the Xml key: <a1:C_XOptions id="ref-1" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/SU2000Plus/sekretariat_RM
2
6293
by: Jarda | last post by:
Hi all, i'm looking for some performance comparison some charts. I have read the xmlserializer is better, more flexible and faster (analyzing data types in constructor), but there are some limitation (i.e. public members). SoapFormatter is better to serialize arbitrary data. I have done some tests and SoapFormatter is faster 5 times than XmlSerializer. I don't undestand it, I have tried large arrays, small string .... the result seems the...
0
1102
by: cmrchs | last post by:
Hi, XmlSerializer can serialize data to a file, but SoapFormatter can do the same except that the serialized data in the file is not proper Xml : for instance there is no XmlRoot-element. Why then use SoapFormatter at all ? thanks Chris
1
2696
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
3778
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
1630
by: JackRazz | last post by:
I'm trying to serialize a collection to a file stream by serializing each object individually. The code below works fine with the BinaryFormatter, but the SoapFormatter reads the first object and just goes to the end of the file. After reading the first object, the fStream.Position is pointed to the end of the file. The collection serializes/deserilizes fine when I just serialize the hashtable vs. each object in the hashtable. Does...
5
2619
by: =?Utf-8?B?TWFydHluIEZld3RyZWxs?= | last post by:
Hi there. I posted an earlier issue under the name "That assembly does not allow partially trusted callers" but have now identified what the issue is. As explained before I am working in ASP.Net 2.0 using VB.Net and had developed an application that ran correctly on my development server but would not run on the shared hosting paltform which I use. The shared hosting runs in medium trust and produced the error "That assembly does not...
0
307
by: =?ISO-8859-1?Q?=22Andr=E9s_G=2E_Aragoneses_=5B_kno | last post by:
Hello. I have found out that a VS2005 WebService by default serializes my objects using normal XmlSerializer. Howerver, I need it to serialize them using SoapFormatter by default (without doing the call in every "return" statement of each of my webmethods). Can this be done? By the way, I would also to call a "SanityCheck()" method for every object that is returned from my webmethods before sending them. Can this be done without AOP? ...
0
9671
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
10854
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...
0
10558
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10600
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,...
0
10257
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9387
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5651
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
5829
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3116
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.