Excerpt |
|
|
| 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 |
|
|
@WebService
public class Hello {
public String sayHi(String name) {
return "Hello " + name;
}
}
|
...
Here's a simple example:
Code Block |
|
|
@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.