Incubator > Beehive
 

Web Services Overview

Beehive Web Services Features

Metadata Annotations

Beehive web services use Java metadata annotations to simply the web service development process. Metadata annotations are easy to learn and use, and offer the developer an especially quick way to change the web service implementation. The annotations offer implementations of the most common web service features, such as (1) conforming to basic SOAP and WSDL standards, (2) separating the public contract and the private implementation, and (3) creating asynchronous communication between the web service and its clients. The basic idea underlying all Beehive web service development is that the developer writes an ordinary Java class, whose functionality is exposed as a web service. The manner of exposure is specified by the metadata annotations that decorate the class and its methods.

Standards Based

Beehive web services are based on the JSR 181 web service standard. JSR 181 sets out the core annotations used to expose Java classes as web services.

No expertise with APIs and Deployment Descriptors Required

Beehive web services are implemented as ordinary Java classes decorated with metadata annotations. The metadata annotations (1) replace the deployment descriptors (that would ordinarily be used to configure the Java class) and (2) encapsulate the web service APIs (that would ordinarily be used by the developer as an implementation resource). The result is a web service implementation that is much easier to learn and understand. Instead of keeping multiple Java classes and XML configuration files in sync, the developer needs to edit only one file: the annotated Java class.

Web Service Basics

What Do Web Services Do?

Web services are servlets that take requests (in the form of XML documents) and send back responses (in the form of XML documents).

Because web services are based on standard technologies (HTTP and XML), they make communication possible even if the parties are running on different operating systems and are written in different languages. For this reason they are an excellent approach for building distributed applications that must incorporate diverse systems over a network.

Web services have the following features:

  • The web service's functionality is publicly described in a WSDL file.
  • Web services communicate with other applications through XML messages, typically in SOAP format.
  • Web services generally use a standard network protocol, such as HTTP.

WSDL Files

The Web Service Description Language (WSDL) is a standard XML format for describing web services. A WSDL file describes a particular web service so that other software applications can interface with it.

WSDLs are generally publicly accessible and provide enough detail so that potential clients can figure out how to operate the service solely from reading the WSDL file. If a web service adds two integers and sends back the result to the client, the WSDL file will explain how the integers should be sent to the web service, and how the resulting sum will be returned to the requesting client.

XML and SOAP

Extensible Markup Language (XML) messages provide a common language by which different applications can talk to one another over a network. A client sends an XML message containing a request to the web service, and the web service responds with an XML message containing the results of the operation. In most cases these XML messages are formatted according to SOAP syntax.

Simple Object Access Protocol (SOAP) specifies a standard format for applications to call each other's methods and pass data to one another. Note that web services may communicate with XML messages that are not SOAP-formatted. The types of messages supported by a particular web service are delineated in the service’s WSDL file.

Network Protocols

Web services receive requests and send responses using widely used protocols such as HyperText Transfer Protocol (HTTP) and Java Message Service (JMS). A web service may support more than one protocol, and different methods on the web service may support different protocols. The protocols that a web service supports are published in the WSDL file.