Confusion arises because there’s no commonly accepted definition of what an object is, let alone what an object model is. XML schema definitions map to some languages’ OO concepts cleanly in some aspects and don’t map at all in other aspects. One commonly used definition of an object is state plus behavior. Web services certainly don’t support that definition.
In other words, there are lots of different “object-oriented” viewpoints. How exactly do you model XML’s “inheritance by restriction” in C#, for example?
SOAP and XML don’t talk about objects at all really. They describe structured data. These are considerably different. I’m not saying it’s not useful to map structured state to/from objects. But when you pass a DataSet, or a Queue, or similar “objects’ you are no longer passing structured state alone, IMO, because such .NET classes also have behavior that you are not passing.
– Brent Rector on the DOTNET-CLR list.
This is one of the points that Dare brought up in his article on XML.com.
this kind of derivation does not neatly map to concepts in either object oriented programming or relational database theory, which are the primary producers and consumers of XML data.
This is a very large part of the problem of web services and their proliferation in.NET. There has been so much focus on the OO aspects of .NET that many developers seem stuck in Design Patterns, so much that they don’t take into account that the “objects” they are passing around are really just XML messages that represent the serialized form of those objects. The WebMethodAttribute attribute in .NET hides the XML-ness of web services to the point that SOAP and its XML roots becomes nearly irrelevant.
This is not a Good Thing.
I have talked at many user groups about XML and .NET, and at each of them I show how to pass XML as an HTTP POST to an ASP.NET page, load the XML up into a DOM or XmlReader, and process it. When I draw the correlation to SOAP message passing, you can see their eyes glaze, as if asking “what do web services have to do with XML?”
SOAP is XML, and XML is just data. It provides rules for how data can be structured so that different parsers can understand the same structure and process it. Yet there seems to be a notion that somehow SOAP adds behaviors onto XML. This is no more true than if I wrote my own XML message:<message action=”Say”><param type=”text”>Hello</param></message>
XML is not about objects, it does not convey behavior. There are even limited mappings from XML concepts to those of the OO world.