Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Warn about databinding reuse

...

AegisDatabinding is the class that integrates Aegis into CXF as a databinding.

Note that AegisDatabinding beans, like all databinding beans, are not reusable. The example
above uses an anonymous nested bean for the databinding. If you make a first-class bean for
a databinding, be sure to use scope='prototype' if you are inclined to define more than one endpoint.

Aegis Operations - The Simple Case

...

Aegis can handle all of these. For all except interfaces, there are two mechanisms that involved: the root class list and xsi:type attributes.

As explained above, Aegis can write 'anything', but it can only read objects of types that are mapped. You must give Aegis a list of all the types that you want to use over and above those visible from the service, and you must instruct Aegis to send xsi:type attributes when sending
objects of such types.
These type attributes allow Aegis to identify the type of these additional objects and look them up in the mappings.

Interfaces and abstract types require one further step. Obviously, Aegis cannot instantiate (run 'new') on an interface. So Thus, knowing that a particular XML Schema type maps to an interface is not enough information. To be able to read an XML element that corresponds to an interface, Aegis must know a 'proxy class' that implements the interface. You must give Aegis a mapping from interface types to proxy class names.

...

  • rootClasses is a collection of Java Class<?> objects. These are added to the list of types known to Aegis. Aegis will create a mapping for each. For convenience, there is a rootClassNames property for use from Spring. It is a list of Strings containing class names.
  • writeXsiTypes is a boolean. Set it to true to send xsi:type attributes.

...

  • defaultNillable defines the default value of the nillable attribute of xsd:element items in the xsd:sequences built for non-primitive types. By default, it is true, since any Java reference can be null. However, nillable='true' has annoying consequences in some wsdl2java tools (turning scalars into arrays, e.g.), and so many programmers prefer to default to false.

...

By and large, front-ends map services to XML schema, filling in XML Schema elements and types for messages and parts. Data bindings then map from those schema items to Java. However, Aegis also provides XML configuration for methods and parameters, which 'poach' in the territory of the front end. This works well for the Simple front end, which has no other way to control these mappings. The present author is not sure what will happen in the event of a conflict between Aegis and any other front-end, like JAX-WS, that has explicit configuration. The Thus, Aegis service configuration is best used with the Simple front end.

...

This is a copy of the XML Schema for mapping XML files that is annotated with comments.

Bean

...

Mapping

Here is a very simple mapping. It takes a property named 'horse', renames it to 'feathers', and makes it an attribute instead of an element.

...

Later on, we will explain how to replace the default mappings that Aegis provides for basic types. However, tehre there are some cases where you may want to simply specify one of the provided type mappings for one of your properties. You can do that from the XML mapping file without creating any Java customization.

...

This example specifies that getUnannotatedStrings returns a return an element names named UnannotatedStringCollection which is a raw collection of String values. It then specifies the first parameter of getValues is also a raw collection of String values.

...

Note, however, that Aegis goes does not handle package-info.java classes, and so XmlSchema must be applied to a class.

...