Data Binding

Data binding is the process of converting objects described in an XML document to Java objects and vice versa. You can generate data binding classes directly from a WSDL or schema document or while generating a Java or Spring component implementation.

TIBCO Business Studio supports two data binding technologies: JAXB and XMLBeans. The default mapping of WSDL and XSD schema elements to Java programming language elements is described in Default XML to Java Mapping.

Data Binding Configuration Files

You can change the mapping of XML elements to Java objects by specifying mapping constraints in a data binding configuration file. Each data binding technology has its own configuration file format: XMLBeans XSDCONFIG or JAXB XJB. See the XMLBeans and JAXB specifications for the formats of their configuration files.

For example, the following XMLBeans configuration file maps the target namespace http://ns.tibco.com/Hello/ to the package com.sample.othername.hello and specifies suffixes, prefixes, and name replacements for generated classes.
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config"
           xmlns:ct="http://ns.tibco.com/Hello/">

  <xb:namespace uri="http://ns.tibco.com/Hello/ http://someurihere.com">
    <xb:package>com.sample.othername.hello</xb:package>    	
  </xb:namespace>

	
  <!-- 
    The ##any value is used to indicate "all URIs". 
    The <prefix> tag is used to prepend to top-level Java type names generated in the specified namespace. 
    The <suffix> tag is used to append to top-level Java types names generated in the specified namespace.
    The <prefix> and <suffix> are not used for inner Java types.
  -->
  
  <xb:namespace uri="##any">
    <xb:prefix>Xml</xb:prefix>
    <xb:suffix>BeanClass</xb:suffix>
  </xb:namespace>


  <!-- The <qname> tag specifies a Java class name for a qualified name -->   
  <xb:qname name="ct:HelloResponse" javaname="TheHelloResponse" />

</xb:config>