You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Andrey Utkin <ci...@gmail.com> on 2008/11/26 22:22:49 UTC

SDO - save/restore DataObject to/from XML

Hi all,

I have tow applications uses SDO for internal business object
representation. They defines Types dynamically without XSD.
One application have to pass objects to another. I supposed the simplest way
to do it is to serialize DataObject to XML, pass XML to another peer, and
then deserialize it back to DataObject. But it is not so simple as I thought
:)

As I understand specification and samples I should do following:
- using XSDHelper.generate() I have to save Type XSD from one application
and pass XSD to other side. On other side using XSDHelper.define() define
the new type by provided XSD.
- than I could save DataObjects to XML by XMLHelper.save() and pass XMLs to
another application. But the generated XML don`t follow the XSD produced for
the Type early... So the second application can`t load DataObject correctly.
The main inconsistency is that all data object properties serialized as
elements instead of attributes (in the generated Type XSD they defined as
attributes).

I played with samples from specification (SDO 2.1.0 FINAL). I define dynamic
Type "customer" as on 3.8.4 & 3.8.5. and then create XML as on
3.11.8.Resulting XML generated by Tuscany differ from the one on
3.11.8. Instead of using attributes for properties (custNum, firstName..)
Tuscany use elements. May be it is correct...
So, is there another correct way to exchange DataObjects between too
applications when Types defined dynamically?

Thanks.