STom,
Xml Serialization, or Xml data binding, is a great way to make any kind of
rigidly structured Xml data available to an object-oriented application. As
Dino pointed out, there are many different scenarios when parsing or
creating Xml through serialization is useful. What these scenarios have in
common, is that you
* access a large portion of the document, i.e. going through XPath and DOM
would add considerable overhead,
* you do not have mixed content
* you don't require "positional" access to the Xml content
* you process many different node from the document so DOM-based access
would lead to cluttered, hard-to-read code.
It is most natural, when you build applications that exchange messages in a
somewhat object-oriented Xml format, such as those defined by Xml Schemas.
Using Xml serialization you can transform the data you transform into the
most suitable representation, objects within you application and Xml when
you transfer them.
In contrast to remoting (any remoting technology, not just .NET Remoting),
these messages do typically not represent method calls. They represent data,
possibly defined by a type in an Xml Schema, not just a .NET type. With
serialization, you do not require the same .NET type to map the the XML
type, i.e. two applications exchanging Xml messages can implement their own
classes as long as they map to the same Xml type. These types can even use
different binding technologies, such as XmlSerialization in .NET and Castor
in java.
Other examples of regidly structured Xml data are Xml-based protocols, such
as Soap or xmlCIM. It is much easier to precess those via XmlSerialization
since most likely need to access data from the entire message.
Dare Obasanjo had an article on XML.COM comparing the different Xml APIs [0]
that also fits into this context.
--
HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor
[0]
http://www.xml.com/pub/a/2003/07/09/xmlapis.html
"STom" <st***********@hotmail.com> wrote in message
news:OO**************@TK2MSFTNGP11.phx.gbl...
I have just started reading up on XMLSerialization and still do not
understand the practical use of this technology.
For example, if I have to know the class type on the client and on the web
service side, wouldn't it be easier to just use .Net remoting?
I envision some point of passing over the XML document but the web service
not really knowing about the objects type.
Am I way off base with my perceptions?
STom