Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: fix mistake about defaults

...

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 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..

Code Block
xml
xml

 <bean id="aegisBean" class="org.apache.cxf.aegis.databinding.AegisDatabinding" scope="prototype"/> 
  <simple:server id="pojoservice" serviceClass="demo.hw.server.HelloWorld" address="/hello_world">
  	<simple:serviceBean>
  		<bean class="demo.hw.server.HelloWorldImpl" />
  	</simple:serviceBean>
        <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>
-->
  </simple:server>
 </bean>

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

...

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();

...