Why Aegis?
Aegis is a fast StAX based data-binding that makes developing code first services as simply as possible. It is able to handle most classes and create intelligent schemas for them.
Features include:
- No annotations are needed to expose classes
- Support for interfaces
- Support for collections including Maps
- Support for a wide variety of datatypes
Using Aegis
To configure your Server or Client to use the Aegis databinding, you'll need to configure your ServerFactoryBean and ClientFactoryBeans to use the aegis databinding.
Code Block | ||||
---|---|---|---|---|
| ||||
import org.apache.cxf.aegis.databinding.AegisDatabinding; import org.apache.cxf.frontend.ServerFactoryBean; ServerFactoryBean sf = new ServerFactoryBean(); sf.setServiceClass(serviceClass); sf.setAddress("http://myhost/service"); sf.getServiceFactory().setDataBinding(new AegisDatabinding()); sf.create(); |
If you need to ensure that your service is backward compatabile with XFire, you'll want to add one other line:
Code Block | |
---|---|
java | |
import org.apache.cxf.aegis.databinding.AegisServiceConfiguration;
sf.getServiceFactory().getServiceConfigurations().add(0, new AegisServiceConfiguration());
|
This will the change the namespaces that CXF generates by default so that they are the same as XFire would generate.
Similarly, you'll need to set up the client side:
Code Block | ||||
---|---|---|---|---|
| ||||
import org.apache.cxf.aegis.databinding.AegisDatabinding;
import org.apache.cxf.frontend.ClientProxyFactoryBean;
ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
factory.setServiceClass(serviceClass);
factory.setAddress("http://myhost/service");
factory.getServiceFactory().setDataBinding(new AegisDatabinding());
MyService client = (MyService) factory.create();
|
XFire Compatability
If you need to ensure that your service is backward compatabile with XFire, you'll want to add one other line:
Code Block | ||||
---|---|---|---|---|
| ||||
import org.apache.cxf.aegis.databinding.AegisServiceConfiguration; sf.getServiceFactory().getServiceConfigurations().add(0, new AegisServiceConfiguration()); |
This will the change the namespaces that CXF generates by default so that they are the same as XFire would generate.
More Information....
This section is under construction. For more information about how the Aegis databinding works, please check out the Aegis documentation at the XFire site (http://xfire.codehaus.org/User's+Guide).