blob: 7602560b69796ba159d6322f9ab15e818b590a49 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<link type="text/css" rel="stylesheet" href="/resources/site.css">
<script src='/resources/space.js'></script>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="business integration, EAI, SOA, Service Oriented Architecture, web services, SOAP, JBI, JMS, WSDL, XML, EDI, Electronic Data Interchange, standards support, integration standards, application integration, middleware, software, solutions, services, CXF, open source">
<meta name="description" content="Apache CXF, Services Framework - XFire Migration Guide">
<link type="text/css" rel="stylesheet" href="/resources/highlighter/styles/shCoreCXF.css">
<link type="text/css" rel="stylesheet" href="/resources/highlighter/styles/shThemeCXF.css">
<script src='/resources/highlighter/scripts/shCore.js'></script>
<script src='/resources/highlighter/scripts/shBrushXml.js'></script>
<script src='/resources/highlighter/scripts/shBrushJava.js'></script>
<script>
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.all();
</script>
<title>
Apache CXF -- XFire Migration Guide
</title>
</head>
<body onload="init()">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td id="cell-0-0" colspan="2">&nbsp;</td>
<td id="cell-0-1">&nbsp;</td>
<td id="cell-0-2" colspan="2">&nbsp;</td>
</tr>
<tr>
<td id="cell-1-0">&nbsp;</td>
<td id="cell-1-1">&nbsp;</td>
<td id="cell-1-2">
<!-- Banner -->
<div class="banner" id="banner"><div><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left" colspan="1" nowrap>
<a shape="rect" href="http://cxf.apache.org/" title="Apache CXF"><span style="font-weight: bold; font-size: 170%; color: white">Apache CXF</span></a>
</td><td align="right" colspan="1" nowrap>
<a shape="rect" href="http://www.apache.org/" title="The Apache Sofware Foundation"><img border="0" alt="ASF Logo" src="http://cxf.apache.org/images/asf-logo.png"></a>
</td></tr></table></div></div>
<!-- Banner -->
<div id="top-menu">
<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tr>
<td>
<div align="left">
<!-- Breadcrumbs -->
<a href="index.html">Index</a>&nbsp;&gt;&nbsp;<a href="how-tos.html">How-Tos</a>&nbsp;&gt;&nbsp;<a href="migration-guides.html">Migration Guides</a>&nbsp;&gt;&nbsp;<a href="xfire-migration-guide.html">XFire Migration Guide</a>
<!-- Breadcrumbs -->
</div>
</td>
<td>
<div align="right">
<!-- Quicklinks -->
<div id="quicklinks"><p><a shape="rect" href="http://cxf.apache.org/download.html">Download</a> | <a shape="rect" href="http://cxf.apache.org/docs/index.html">Documentation</a></p></div>
<!-- Quicklinks -->
</div>
</td>
</tr>
</table>
</div>
</td>
<td id="cell-1-3">&nbsp;</td>
<td id="cell-1-4">&nbsp;</td>
</tr>
<tr>
<td id="cell-2-0" colspan="2">&nbsp;</td>
<td id="cell-2-1">
<table>
<tr valign="top">
<td height="100%">
<div id="wrapper-menu-page-right">
<div id="wrapper-menu-page-top">
<div id="wrapper-menu-page-bottom">
<div id="menu-page">
<!-- NavigationBar -->
<div id="navigation"><ul class="alternate"><li><a shape="rect" href="overview.html">Overview</a></li><li><a shape="rect" href="how-tos.html">How-Tos</a></li><li><a shape="rect" href="frontends.html">Frontends</a></li><li><a shape="rect" href="databindings.html">DataBindings</a></li><li><a shape="rect" href="transports.html">Transports</a></li><li><a shape="rect" href="configuration.html">Configuration</a></li><li><a shape="rect" href="debugging-and-logging.html">Debugging and Logging</a></li><li><a shape="rect" href="tools.html">Tools</a></li><li><a shape="rect" href="restful-services.html">RESTful Services</a></li><li><a shape="rect" href="wsdl-bindings.html">WSDL Bindings</a></li><li><a shape="rect" href="service-routing.html">Service Routing</a></li><li><a shape="rect" href="dynamic-languages.html">Dynamic Languages</a></li><li><a shape="rect" href="ws-support.html">WS-* Support</a></li><li><a shape="rect" href="advanced-integration.html">Advanced Integration</a></li><li><a shape="rect" href="deployment.html">Deployment</a></li><li><a shape="rect" href="schemas-and-namespaces.html">Use of Schemas and Namespaces</a></li></ul><hr><ul class="alternate"><li><p>Search</p></li></ul><form enctype="application/x-www-form-urlencoded" method="get" id="cse-search-box" action="http://www.google.com/cse">
<div>
<input type="hidden" name="cx" value="002890367768291051730:o99qiwa09y4">
<input type="hidden" name="ie" value="UTF-8">
<input type="text" name="q" size="21">
<input type="submit" name="sa" value="Search">
</div>
</form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script><hr><ul class="alternate"><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest/">API 3.2.x (Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-3.1.x/">API 3.1.x (Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/">CXF Website</a></li></ul><p>&#160;</p><p><a shape="rect" class="external-link" href="http://www.apache.org/events/current-event.html"><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-external-resource" src="http://www.apache.org/events/current-event-125x125.png" data-image-src="http://www.apache.org/events/current-event-125x125.png"></span></a></p></div>
<!-- NavigationBar -->
</div>
</div>
</div>
</div>
</td>
<td height="100%">
<!-- Content -->
<div class="wiki-content">
<div id="ConfluenceContent"><style type="text/css">/*<![CDATA[*/
div.rbtoc1636141741935 {padding: 0px;}
div.rbtoc1636141741935 ul {list-style: disc;margin-left: 0px;padding-left: 20px;}
div.rbtoc1636141741935 li {margin-left: 0px;padding-left: 0px;}
/*]]>*/</style><div class="toc-macro rbtoc1636141741935">
<ul class="toc-indentation"><li><a shape="rect" href="#XFireMigrationGuide-CompletedFunctionalityandCXFanalogues">Completed Functionality and CXF analogues</a></li><li><a shape="rect" href="#XFireMigrationGuide-ShouldIMigrateYet?">Should I Migrate Yet?</a>
<ul class="toc-indentation"><li><a shape="rect" href="#XFireMigrationGuide-Whoshouldnotmigrate">Who should not migrate</a></li></ul>
</li><li><a shape="rect" href="#XFireMigrationGuide-ServiceFactories">Service Factories</a>
<ul class="toc-indentation"><li><a shape="rect" href="#XFireMigrationGuide-ExampleObjectServiceFactoryMigration">Example ObjectServiceFactory Migration</a></li><li><a shape="rect" href="#XFireMigrationGuide-ExampleAnnotationServiceFactoryMigration">Example AnnotationServiceFactory Migration</a></li><li><a shape="rect" href="#XFireMigrationGuide-ExampleJAXWSServiceFactoryMigration">Example JAXWSServiceFactory Migration</a></li></ul>
</li><li><a shape="rect" href="#XFireMigrationGuide-HTTPandServletSetup">HTTP and Servlet Setup</a></li><li><a shape="rect" href="#XFireMigrationGuide-services.xml">services.xml</a></li></ul>
</div>
<h1 id="XFireMigrationGuide-CompletedFunctionalityandCXFanalogues">Completed Functionality and CXF analogues</h1>
<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> XFire Feature </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> CXF Analogue </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> Aegis Binding </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <a shape="rect" href="aegis-databinding-20x.html">Ported</a>. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> Configurable Servlet </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> See the <a shape="rect" href="servlet-transport.html">Servlet Transport</a> page. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> Eclipse Plugin <br clear="none" class="atl-forced-newline"> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Eclipse tooling supported via the WTP project and will be included as part of Helios. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> HTTP Transport </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <a shape="rect" href="http-transport.html">Ported</a>. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> JMS Transport </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <a shape="rect" href="jms-transport.html">Ported</a>. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> JAX-WS/JSR-181 Annotation Support </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Ported and CXF passes the JAX-WS/JWS TCKs. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> JAXB </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Ported. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> MTOM <br clear="none" class="atl-forced-newline"> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <a shape="rect" href="mtom-attachments-with-jaxb.html">Ported</a> - Supports fully streaming attachments now. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> services.xml </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Spring 2 XML will be supported for easy configuration. See the <a shape="rect" href="configuration.html">Configuration</a> section. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> Spring: XFireClientFactoryBean </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> See the ClientProxyFactoryBean and JaxWsProxyFactoryBean. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> Spring: XFireExporter </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Not ported as the *ServerFactoryBeans already enable this functionality. See below. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> Spring: ServiceBean </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Completed. See ServerFactoryBean and JaxWsServerFactoryBean. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> WS-Addressing <br clear="none" class="atl-forced-newline"> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> CXF has much better <a shape="rect" href="ws-addressing.html">WS-Addressing</a> support and its easier to use as well. <br clear="none" class="atl-forced-newline"> </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> WS-Security </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <a shape="rect" href="ws-security.html">Ported</a>. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> XMLBeans </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <a shape="rect" href="xmlbeans.html">Ported</a> </p></td></tr></tbody></table></div>
<p>For more details on how to migrate:</p>
<ul><li>Are you using the ObjectServiceFactory, AnnotationServiceFactory, or JAXWSServiceFactory? <a shape="rect" href="xfire-migration-guide.html">Go-&gt;</a></li><li>Are you using services.xml? <a shape="rect" href="xfire-migration-guide.html">Go-&gt;</a></li><li>Are you using the XFireServlet? <a shape="rect" href="xfire-migration-guide.html">Go-&gt;</a></li><li>Are you using the Spring ServiceBean? <a shape="rect" href="xfire-migration-guide.html">Go-&gt;</a></li><li>Are you using the Spring XFireExporter? <a shape="rect" href="xfire-migration-guide.html">Go-&gt;</a></li></ul>
<h1 id="XFireMigrationGuide-ShouldIMigrateYet?">Should I Migrate Yet?</h1>
<p>XFire users should consider migrating to CXF. Anyone looking to start a new web services project should seriously consider CXF. The main barrier is liable to be documentation at this moment. We will be adding LOTS more documentation though over the next couple weeks as we move toward the 2.0 final release.</p>
<p>CXF includes many new features for XFire users:</p>
<ul><li>Improved WSDL support</li><li>Improved JAX-WS support</li><li>Improved JMS transport</li><li>Maven plugins</li><li>Spring 2.0 syntax support</li><li>Improved WS-* support</li><li>Cleaned up APIs for building services</li><li>Easier to use extension points</li><li>RESTful services support</li><li>Support for a "bare" XML binding, which doesn't include a SOAP envelope</li></ul>
<h2 id="XFireMigrationGuide-Whoshouldnotmigrate">Who should not migrate</h2>
<p>There a couple small areas where we haven't replicated all of the XFire functionality yet. Namely the JiBX databinding. The only other reason not to migrate to CXF that we see is a requirement for Java 1.4. </p>
<h1 id="XFireMigrationGuide-ServiceFactories">Service Factories</h1>
<p>XFire included serveral service factories for building services. CXF also includes service factories, but the concept has been improved somewhat to make them easier to use. CXF now includes the concept of ServerFactoryBeans which produce Servers, ClientFactoryBeans which produce Clients, and ClientProxyFactoryBeans which produce Client proxies.</p>
<p>CXF now includes the following classes:</p>
<ul><li>ServerFactoryBean - This creates a server endpoint from a class</li><li>ClientProxyFactoryBean - this creates a client proxy from a class</li><li>JaxWsServerFactoryBean - This creates a JAX-WS server endpoint from a class or WSDL</li><li>JaxWsProxyFactoryBean - this creates a JAX-WS client proxy from a class</li></ul>
<p>Its important to keep in mind a few differences in how CXF works compared to XFire:</p>
<ul><li>CXF uses a bean factory approach. This means that there is one (Server/ClientProxy)FactoryBean per endpoint. In XFire these beans could be reused.</li><li>CXF requires that you specify the endpoint address, unless it finds it in your WSDL. If you're using HTTP this has some nice benefits.
<ul><li>If you haven't set up the Servlet transport, it will automatically start an embedded Jetty instance for you. In XFire this required you to use the XFireHttpServer class, resulting in additional work.</li><li>This allows you to map services to different URLs easier. In XFire the way URLs were mapped to Services was much more static.</li></ul>
</li><li>When you specify an endpoint address for your service, it's important to remember that when you're using the sServlet you don't need to specify the host name. Lets say you set up the CXFServlet to listen on "http://localhost/services". If you specify your endpoint address as "/myservice" then all requests that come to "http://localhost/services/myservice" will go to your service.</li><li>JAXB is now the <strong>default</strong> databinding. Any time you want to use Aegis, you must explicitly say so.</li></ul>
<h2 id="XFireMigrationGuide-ExampleObjectServiceFactoryMigration">Example ObjectServiceFactory Migration</h2>
<div class="sectionColumnWrapper"><div class="sectionMacro">
<div class="sectionMacroRow"><div class="columnMacro" style="width:50%;min-width:50%;max-width:50%;">
<p>Here is an example of using the ObjectServiceFactory in XFire:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">
ObjectServiceFactory osf = new ObjectServiceFactory();
Service service = osf.create(MyServiceInterface.class);
service.setInvoker(new BeanInvoker(new MyServiceImpl());
</pre>
</div></div></div>
<div class="columnMacro">
<p>This would be the CXF equivalent:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">
ServerFactoryBean sf = new ServerFactoryBean();
sf.getServiceFactory().setDataBinding(new AegisDatabinding();
sf.setServiceBean(new MyServiceImpl());
sf.setServiceClass(MyServiceInterface.class);
sf.setAddress("http://localhost:8080/myservice");
sf.create();
</pre>
</div></div></div></div></div></div>
<h2 id="XFireMigrationGuide-ExampleAnnotationServiceFactoryMigration">Example AnnotationServiceFactory Migration</h2>
<div class="sectionColumnWrapper"><div class="sectionMacro">
<div class="sectionMacroRow"><div class="columnMacro" style="width:50%;min-width:50%;max-width:50%;">
<p>Here is an example of using the AnnotationServiceFactory in XFire:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">
AnnotationServiceFactory osf = new AnnotationServiceFactory();
Service service = osf.create(MyServiceInterface.class);
service.setInvoker(new BeanInvoker(new MyServiceImpl());
</pre>
</div></div></div>
<div class="columnMacro">
<p>This would be the CXF equivalent:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">
JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean ();
sf.getServiceFactory().setDataBinding(new AegisDatabinding());
sf.setServiceClass(MyServiceImpl.class);
sf.setAddress("http://localhost:8080/myservice");
sf.create();
</pre>
</div></div></div></div></div></div>
<h2 id="XFireMigrationGuide-ExampleJAXWSServiceFactoryMigration">Example JAXWSServiceFactory Migration</h2>
<div class="sectionColumnWrapper"><div class="sectionMacro">
<div class="sectionMacroRow"><div class="columnMacro" style="width:50%;min-width:50%;max-width:50%;">
<p>Here is an example of using the JAXWSServiceFactory in XFire:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">
JAXWSServiceFactory sf = new JAXWSServiceFactory();
Service service = sf.create(MyServiceImpl.class);
service.setInvoker(new BeanInvoker(new MyServiceImpl());
</pre>
</div></div></div>
<div class="columnMacro">
<p>This would be the CXF equivalent:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">
JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
sf.setServiceClass(MyServiceImpl.class);
sf.setAddress("http://localhost:8080/myservice");
sf.create();
</pre>
</div></div></div></div></div></div>
<h1 id="XFireMigrationGuide-HTTPandServletSetup">HTTP and Servlet Setup</h1>
<p>CXF supports a much wider range of options for deploying your service over HTTP. XFire created a static mapping between the HTTP URL and the service name - i.e. a service named "HelloService" was accessible at <a shape="rect" class="external-link" href="http://localhost/services/HelloService" rel="nofollow">http://localhost/services/HelloService</a>. CXF on the other hand allows you to control the URL which your service is published on. This address is provided to CXF either through the setAddress() call on the ServerFactoryBeans or via your XML configuration.</p>
<p>Another improvement over XFire is that CXF will now transparently detect whether the CXFServlet is being used. If it is, your service will be available on that location. If it is not, CXF will automatically start an embedded Jetty instance (provided the cxf-rt-transports-http-jetty module is on your classpath). No more calls to XFireHttpServer are needed!</p>
<p>To set up the CXF servlet, please read the how-to on the <a shape="rect" href="servlet-transport.html">Servlet Transport</a> page.</p>
<p>To use the embedded Jetty instance, no extra work is needed. Simply follow the above ServiceFactory examples.</p>
<h1 id="XFireMigrationGuide-services.xml">services.xml</h1>
<p>XFire included support for deploying your services via a services.xml file. In CXF this file is named cxf.xml and will be loaded by the <a shape="rect" href="xfire-migration-guide.html">CXFServlet</a></p>
<div class="sectionColumnWrapper"><div class="sectionMacro">
<div class="sectionMacroRow"><div class="columnMacro" style="width:50%;min-width:50%;max-width:50%;">
<p>XFire services.xml example:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">
&lt;beans xmlns="http://xfire.codehaus.org/config/1.0"&gt;
&lt;service xmlns:t="urn:my:namespace"&gt;
&lt;name&gt;testservice&lt;/name&gt;
&lt;serviceClass&gt;org.example.TestService
&lt;/serviceClass&gt;
&lt;implementationClass&gt;org.codehaus.xfire.spring.TestServiceImpl&lt;/implementationClass&gt;
&lt;namespace&gt;urn:my:namespace&lt;/namespace&gt;
&lt;serviceFactory&gt;org.codehaus.xfire.jaxws.JAXWSServiceFactory&lt;/serviceFactory&gt;
&lt;properties&gt;
&lt;property key="myKey"&gt;value&lt;/property&gt;
&lt;/properties&gt;
&lt;inHandlers&gt;
&lt;handler handlerClass="org.codehaus.xfire.spring.TestHandler"/&gt;
&lt;/inHandlers&gt;
&lt;/service&gt;
&lt;/beans&gt;
</pre>
</div></div></div>
<div class="columnMacro">
<p>CXF example:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">
&lt;beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd"&gt;
&lt;import resource="classpath:META-INF/cxf/cxf.xml" /&gt;
&lt;import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/&gt;
&lt;import resource="classpath:META-INF/cxf/cxf-servlet.xml" /&gt;
&lt;jaxws:endpoint address="http://localhost/testService"
serviceName="t:testService"
xmlns:t="urn:my:namespace"&gt;
&lt;jaxws:implementor&gt;
&lt;bean class="org.example.TestServiceImpl"/&gt;
&lt;/jaxws:implementor&gt;
&lt;jaxws:properties&gt;
&lt;entry key="foo" value="bar"/&gt;
&lt;/jaxws:properties&gt;
&lt;jaxws:inInterceptors&gt;
&lt;bean class="org.example.ExampleInterceptor"/&gt;
&lt;/jaxws:inInterceptors&gt;
&lt;/jaxws:endpoint&gt;
&lt;/beans&gt;
</pre>
</div></div></div></div></div></div>
<p>There are a few important things to note here on the differences:</p>
<ul><li>Many of these attributes are optional, such as the service name</li><li>You don't need to specify a serviceClass if you are using JAX-WS as your service should be annotated with the @WebService.endpointInterface attribute.</li><li>The equivalent of XFire Handlers is <a shape="rect" href="interceptors.html">Interceptors</a> inside CXF. They feature a much improved API!</li></ul>
<p>The above sample is for JAX-WS/JSR181 services. For those developing services without annotations, here's an example for the <a shape="rect" href="simple-frontend.html">Simple Frontend</a>"</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">
&lt;beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:simple="http://cxf.apache.org/simple"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/simple
http://cxf.apache.org/schemas/simple.xsd"&gt;
&lt;simple:server address="http://localhost/testService"
serviceClass="org.example.TestService"&gt;
&lt;simple:serviceBean&gt;
&lt;bean class="org.example.TestServiceImpl"/&gt;
&lt;/simple:serviceBean&gt;
&lt;simple:properties&gt;
&lt;entry key="foo" value="bar"/&gt;
&lt;/jaxws:properties&gt;
&lt;simple:inInterceptors&gt;
&lt;bean class="org.example.ExampleInterceptor"/&gt;
&lt;/simple:inInterceptors&gt;
&lt;/simple:server&gt;
&lt;/beans&gt;
</pre>
</div></div></div>
</div>
<!-- Content -->
</td>
</tr>
</table>
</td>
<td id="cell-2-2" colspan="2">&nbsp;</td>
</tr>
<tr>
<td id="cell-3-0">&nbsp;</td>
<td id="cell-3-1">&nbsp;</td>
<td id="cell-3-2">
<div id="footer">
<!-- Footer -->
<div id="site-footer">
<a href="http://cxf.apache.org/privacy-policy.html">Privacy Policy</a> -
(<a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=27568">edit page</a>)
(<a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=27568&amp;showComments=true&amp;showCommentArea=true#addcomment">add comment</a>)<br>
Apache CXF, CXF, Apache, the Apache feather logo are trademarks of The Apache Software Foundation.<br>
All other marks mentioned may be trademarks or registered trademarks of their respective owners.
</div>
<!-- Footer -->
</div>
</td>
<td id="cell-3-3">&nbsp;</td>
<td id="cell-3-4">&nbsp;</td>
</tr>
<tr>
<td id="cell-4-0" colspan="2">&nbsp;</td>
<td id="cell-4-1">&nbsp;</td>
<td id="cell-4-2" colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-4458903-1");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>