With FUSE Services Framework you can develop your web services with JAX-WS using either a Java-first or WSDL-first approach to development:
Java-first — Considered easier to create and favored for tactical integrations. Java-first services use Java annotations in the code. WSDL and XSD artifacts are generated on-the-fly. See Java-first development with JAX-WS for more information.
WSDL-first — Preferred for strategic service-oriented architecture (SOA). WSDL-first services tend to be modular, platform agnostic, and have better attention to versioning. See WSDL-first development with JAX-WS for more information.
Service-oriented design abstracts data into a common exchange format, typically an XML grammar defined in XML Schema. The JAX-WS specification calls for XML Schema types to be marshaled into Java objects, in accordance with the Java Architecture for XML Binding (JAXB) specification. JAXB defines bindings for mapping between XML Schema constructs and Java objects, and defines rules for how to marshal the data. It also defines an extensive customization framework for controlling how data is handled. See JAXB data bindings for more information.
You can develop your services from Java code using the JAX-WS APIs, bypassing the WSDL contract. The code can be a class, or classes, from a legacy application that is being upgraded. It can also be a class that is currently used as part of a non-distributed application with features that you want to use in a distributed manner. To use the class, you annotate the Java code and generate a WSDL document from the annotated code. If you do not want to work with WSDL at all, you can create the entire application without ever generating WSDL.
You might have Java code that already implements a set of functionality that you want to expose as part of a service oriented application, or you might want to avoid using WSDL to define your interface. Using JAX-WS annotations, you can add the information required to service enable a Java class. You can also create a Service Endpoint Interface (SEI) that can be used in place of a WSDL contract. If you want a WSDL contract, FUSE Services Framework provides tools to generate a contract from annotated Java code.
See the following references for more information:
Java-First JAX-WS Service Development explains how to work with a sample using Java-first service development.
Developing Applications Using JAX-WS provides information about Java-first front end programming using JAX-WS.
Tool Reference describes the code generation tools available with FUSE Services Framework, including the java2ws tool.
The use case "Creating and Hosting a Web Service" in the Logisticx Tutorial Guide examines sample code that uses notations and an SEI in place of a WSDL contract.
Another way to develop services is to start with a WSDL contract. The WSDL contract provides an implementation-neutral way of defining the operations a service exposes and the data that is exchanged with the service. FUSE Services Framework provides tools to generate JAX-WS annotated code from a WSDL contract. The code generators create all of the classes necessary to implement any abstract data types defined in the contract.
In the top-down method of developing a service provider, you start from a WSDL document that defines the operations and methods the service provider will implement. Using the WSDL document, you generate starting point code for the service provider. Adding the business logic to the generated code is done using Java programming APIs.
See the following references for more information:
WSDL-first JAX-WS Service Development explains how to work with a sample using WSDL-first service development.
Developing Applications Using JAX-WS provides information about WSDL-first front end programming using JAX-WS.
Tool Reference describes the code generation tools available with FUSE Services Framework, including wsdl2java and wsdl2js tools.
You use Java Architecture for XML Binding (JAXB) data bindings with JAX-WS front ends. JAXB is the default data binding for FUSE Services Framework. If you do not specify different data bindings, you will automatically get JAXB data bindings.
JAXB enables you to store and retrieve data in memory in any XML format, without the need to implement a specific set of XML loading and saving routines for the program's class structure. JAXB allows you to map Java classes to XML representations, enabling you to:
Marshal Java objects into XML
Unmarshal XML back into Java objects
JAXB is particularly useful when your service specification is complex and changing. Regularly changing the XML Schema definitions to keep them synchronized with the Java definitions can be time consuming and error prone.
JAXB uses Java annotation combined with files found on the classpath to build the mapping between XML and Java. JAXB supports both code-first and schema-first programming. Schema-first programming supports the ability to create a client proxy, dynamically, at runtime.
See the following references for information about JAXB data bindings:
Basic Data Binding Concepts in
JAXB section of the Apache CXF User's Guide provides additional information about JAXB data bindings.
HTTP is the underlying transport for the web. It provides a standardized, robust, and flexible platform for communicating between endpoints. Because of these factors it is the assumed transport for most WS-* specifications.
See Using the Bindings and Transports for information about using transports with FUSE Services Framework.