...
- Axis1 uses DOM
- Axis2 uses AXIOM
- JAX-WS uses JAXB
Implementation technologies may impose requirements on the data too. For example, the Apache ODE BPEL engine only consumes/produces data using DOM. And SAXON XQuery engine uses NodeInfo.
Application developers should have the freedom to choose their preferred data representation and components with compatible data should be able to interoperate without the intervention of the business logic. With the ability to attach data transformation mediations to wires, this actually becomes a requirement to support any data type that can be mapped from client to provider and back again.
...
- <interface.xxx> defines the inbound service contract (SC2) which can be wired from a source component, reference or service (SC1).
- <binding.xxx> can optionally hint a service contract (SC3) for the outbound data to the binding protocol layer.
Data transformation for property values
- Property values are loaded from SCDLs as DOM documents
- The DOM Document can be transformed into a java object under a databinding, such as SDO, JAXB so that the component implementation code can work with the databinding directly instead of DOM.
The data model
Code Block |
---|
<schema targetNamespace="http://www.example.com/Customer" xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:cust="http://www.example.com/Customer">
<element name="customer" type="cust:Customer" />
<complexType name="Customer">
<sequence>
<element name="customerId" type="string" />
<element name="name" type="string" />
<element name="billingAddress" type="cust:Address" />
<element name="mailingAddress" type="cust:Address" />
</sequence>
</complexType>
<complexType name="Address">
<sequence>
<element name="street" type="string" />
<element name="city" type="string" />
<element name="state" type="string" />
<element name="zipCode" type="string" />
</sequence>
</complexType>
</schema>
|
Source Concrete Type | Source Declared Type | Target Concrete Type | Target Declared Type | Support |
---|---|---|---|---|
JAXBCustomer | java.lang.Object | SDOCustomer | java.lang.Object | Y |
JAXBCustomer | customer.Customer | SDOCustomer | customer.Customer |
|
|
|
|
|
|
- the binding protocol layer.
Data transformation for property values
- Property values are loaded from SCDLs as DOM documents
- The DOM Document can be transformed into a java object under a databinding, such as SDO, JAXB so that the component implementation code can work with the databinding directly instead of DOM.
Note | ||
---|---|---|
|
...
Code Block |
---|
/** * A transformer provides the data transformation from source type to target type. The cost of the transformation is * modeled as weight. */ public interface Transformer { /** * Get the source type that this transformer transforms data from. The type is used as the key when the transformer * is registered with TransformerRegistry. * * @return A key indentifying the source type */ String getSourceDataBinding(); /** * Get the target type that this transformer transforms data into. The type is used as the key when the transformer * is registered with TransformerRegistry. * * @return A key indentifying the target type */ String getTargetDataBinding(); /** * Get the cost of the transformation. The weight can be used to choose the most efficient path if there are more * than one available from the source to the target. * * @return An integer representing the cost of the transformation */ int getWeight(); } /** * PullTransformer transforms data from one binding format to the other one which can be directly consumed * * @param <S> The source data type * @param <R> the target data type */ public interface PullTransformer<S, R> extends Transformer { /** * Transform source data into the result type. * * @param source The source data * @param context The context for the transformation * @return The transformed result */ R transform(S source, TransformationContext context); } |
...