Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: UPdated annotations link
Excerpt
hiddentrue

A meta guide to your options with CXF


CXF provides you with many options to build services. This guide is meant to give you a quick overview of those options and help you orient yourself quickly with CXF.

Table of Contents

Different Types Of Services

...

The JAX-WS APIs include a set of annotations which allow you to build services using annotated classes. These services are based on a single class which contains a set of operations.

Here's a simple example:

Code Block
java
java

@WebService
public class Hello {
  public String sayHi(String name) {
    return "Hello " + name;
  }
}

...

Here's a simple example:

Code Block
java
java

@WebServiceProvider
public class HelloProvider {
  public Source invoke(Source request) {
    return ....;
  }
}

...

CXF provides a Javascript module which allows you to build services in Javascript with the Java Rhino library. One advantage of this is that you can use E4X to interact more easily with the XML. For more information see the Javascript JavaScript page.