14.7 XMLBeans

XMLBeans is an XML binding tool that has full XML Schema support, and offers full XML Infoset fidelity. It takes a different approach to that of most other O/X mapping frameworks, in that all classes that are generated from an XML Schema are all derived from XmlObject, and contain XML binding information in them.

For more information on XMLBeans, refer to the XMLBeans web site . The Spring-WS integration classes reside in the org.springframework.oxm.xmlbeans package.

14.7.1 XmlBeansMarshaller

The XmlBeansMarshaller implements both the Marshaller and Unmarshaller interfaces. It can be configured as follows:

<beans>

    <bean id="xmlBeansMarshaller" class="org.springframework.oxm.xmlbeans.XmlBeansMarshaller" />
    ...

</beans>
[Note]Note

Note that the XmlBeansMarshaller can only marshal objects of type XmlObject, and not every java.lang.Object.

14.7.1.1 XML Schema-based Configuration

The xmlbeans-marshaller tag configures a org.springframework.oxm.xmlbeans.XmlBeansMarshaller. Here is an example:

<oxm:xmlbeans-marshaller id="marshaller"/>

Available attributes are:

AttributeDescriptionRequired
idthe id of the marshallerno
optionsthe bean name of the XmlOptions that is to be used for this marshaller. Typically a XmlOptionsFactoryBean definitionno