apachecreateelementapache-tuscany

How to use element DataObject with Apache Tuscany?


I have a an XSD schema which contains both xsd types and elements of that types.

Like this:

TargetNamespace: http://mycorp.com/ws
Type: PaymentType
Element: PaymentElement

I need to create a commonj.sdo.DataObject representing the PaymentElement. All I can do with the Tuscany API is create commonj.sdo.DataObject of type PaymentType, which is not suitable.

I created it like so:

DataFactory factory = scope.getDataFactory();
DataObject req = factory.create("http://mycorp.com/ws", "PaymentType");

How can I create commonj.sdo.DataObject elements?


Solution

  • I managed to solve this. The trick was to create a subtype of element's type with name same as the element's name.

    More info in my question in CXF mailing list. link

    The solution is not so clean but allows a correct serialization etc.