If I remember correctly, we set the databinding to be java:complexType or java:simpleType. For some of the transformations, we treat them as JAXB, for example POJO --> XML or POJO --> JSON.
Thanks, Raymond ________________________________________________________________ Raymond Feng rf...@apache.org Apache Tuscany PMC member and committer: tuscany.apache.org Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com Personal Web Site: www.enjoyjava.com ________________________________________________________________ On Sep 13, 2011, at 7:51 AM, Simon Laws wrote: > On Tue, Sep 13, 2011 at 11:18 AM, Simon Laws <simonsl...@googlemail.com> > wrote: >> How should the databinding be configured for a non-JAXB Java bean? >> >> Currently in 2.x I'm seeing that the data type that gets generated >> does have a databinding set to java:complexType but the logical type >> is set to the default XMLType, i.e. it has a null element name and a >> null XSD type. In the DefaultDataBindingExtensionPoint I seem the >> following code and comment: >> >> public boolean introspectType(DataType dataType, Operation operation) { >> loadDataBindings(); >> for (DataBinding binding : databindings) { >> // don't introspect for JavaBeansDatabinding as all javatypes will >> // anyways match to its basetype >> // which is java.lang.Object. Default to this only if no >> databinding >> // results >> if (!binding.getName().equals(JavaBeansDataBinding.NAME)) { >> if (binding.introspect(dataType, operation)) { >> return true; >> } >> } >> } >> >> It's not clear what the default databinding should be set to in the >> case of a Java bean. xsd:any? This is currently causes the properties >> itest to fail a it complains about missing types in the model. I'll >> take a look and see what we did in 1.x as I believe the properties >> test ran clean there but if anyone knows then that would be useful >> >> Regards >> >> Simon >> >> -- >> Apache Tuscany committer: tuscany.apache.org >> Co-author of a book about Tuscany and SCA: tuscanyinaction.com >> > > Well in 1.x we didn't set a type either but we seemingly didn't check > for it so it doesn't get raised as an error. The OASIS code is a bot > more particular. > > It seems we don't try to fluff up and XSD type for plain Java beans. > Not even a default JAXB mapping. It seems that this is by design. Is > anyone able to explain before I change anything? > > Simon > > -- > Apache Tuscany committer: tuscany.apache.org > Co-author of a book about Tuscany and SCA: tuscanyinaction.com