How do I develop a service?Page edited by Glen Mazza
Comment:
Removed plug for simple front end.
Changes (2)
Full ContentCXF 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. Different Types Of ServicesCXF support three major types of services:
JAX-WS Annotated Services from JavaThe 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: @WebService public class Hello { public String sayHi(String name) { return "Hello " + name; } } JAX-WS includes many more annotations as well such as:
More Information: A simple JAX-WS service, Developing a JAX-WS Service (goes into much more depth), Writing a service with Spring JAX-WS Annotated Services from WSDLIf you have existing WSDLs for your service or wish to write your WSDL first and then generate classes, CXF has many tools to help you do this. The WSDL2Java tool will generate a JAX-WS annotated service and server stub from your WSDL. You can run it one of three ways:
Note that CXF generally restricts WSDL support to WSI-BP, not the full WSDL 1.1 specification. There is also a Simple Frontend that allows you to create services without usage of Java annotations, using XML configuration files instead. JAX-WS ProvidersJAX-WS Providers allow you to create services which work at the message level - as opposed to the operation level as with annotated classes. The have a single operation "invoke" which receives either the message payload (i.e. the SOAP Body) or the whole message itself (i.e. the SOAP Envelope). Here's a simple example: @WebServiceProvider public class HelloProvider { public Source invoke(Source request) { return ....; } } Services are publish via one of two means:
More Information: Developing a JAX-WS Service _javascript_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_ page.
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|
