Migrating applications from Celtix to CXF is reasonably straightforward; both follow the JAX-WS mapping so the bulk of application code will no require any modification.
Here are some things to look out for:
- There are some obvious changes of package names from
org.apache.cxf.*. If you have used any Celtix-specific non-JAX-WS APIs in your application (for example, using the
Bus), then you must change imported package names.
- There is no
Bus.getCurrent()method. In CXF, you can create a bus using concrete implementations of the
BusFactory.createBus()method, and then make your new bus the default bus as shown below.
Later, to get the bus, you can call:
- On your classpath, change
cxf-manifest.jar; this jar contains manifest entries to pick up all other required jars in the CXF runtime.
- If you call
getPort()on the client side, then you must specify the target namespace of the WSDL contract as the namespace of the port name, like this:
In Celtix you could leave the namespace of the port name as an empty string "". However, if you do that in CXF, the call to
getPort() will fail. This latter behavior is more in keeping with the JAX-WS specification (see Section 4.2.3 of the JAX-WS Specification).