Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: stop pushing Aegis users to JAX-WS by accident.

...

This Page, which is a work in progress, explains some of the modularity of Aegis. You may find it helpful in understanding Aegis' behavior and in developing customizations.

Using Aegis

Most people who use Aegis use the Simple Front End. It configures Aegis by default, and requires a minimum of fuss and bother. If you are using Aegis, you can't move your code to some other web service framework without modifying all your code to work with JAXB or some other binding, so there's not much advantage to using the JAX-WS front-end. You might want to use Aegis with one of the specialized frontends, like JAX-RS. We don't have examples of that in this documentation.

If you don't use the simple front end, you must configure your Server or Client 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, as described below.

Spring Configuration

Most people who use Aegis use the 'Simple' front end. See Simple Frontend for instructions of Spring configuration.

You can also use Aegis with JAX-WS. Here's a Spring configuration example for that.

Code Block
xml
xml
 <bean id="aegisBean" class="org.apache.cxf.aegis.databinding.AegisDatabinding" scope="prototype"/> 
 <bean id="jaxws-and-aegis-service-factory"
    class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"
    scope="prototype"> 
        <property name="dataBinding" ref="aegisBean"/>
<!-- Use this property only for XFire compatibility -- this version for 2.0.x ...
                 <property name="serviceConfigurations">
                     <list>
                       <bean class="org.apache.cxf.jaxws.support.JaxWsServiceConfiguration"/>
                       <bean class="org.apache.cxf.aegis.databinding.AegisServiceConfiguration"/>
                       <bean class="org.apache.cxf.service.factory.DefaultServiceConfiguration"/> 
                    </list>
                </property>
-->
<!-- Use this property only for XFire compatibility -- this version for 2.1
                 <property name="serviceConfigurations">
                     <list>
                       <bean class="org.apache.cxf.jaxws.support.JaxWsServiceConfiguration"/>
                       <bean class="org.apache.cxf.aegis.databinding.XFireCompatibilityServiceConfiguration"/>
                       <bean class="org.apache.cxf.service.factory.DefaultServiceConfiguration"/> 
                    </list>
                </property>
-->
 </bean>

 <jaxws:endpoint id="my_service_endpoint" implementor="#my-service" address="/MyIndex">
  <jaxws:serviceFactory>
   <ref bean='jaxws-and-aegis-service-factory' />
  </jaxws:serviceFactory>
 </jaxws:endpoint>
 

Java configuration

Here's a Java configuration using the Simple front end. It explicitly sets up the Aegis data binding.

Code Block
java
java
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();

Similarly, you'll need to set up the client side:here is a client side using the simple front end. note the 'serviceClass', as always with the simple front end, should be a class, not an interface, since interfaces don't carry parameter names.

Code Block
java
java
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();

...