11 WebLogic Server Web Services

This chapter offers an introduction to WebLogic Server Web services.

This chapter includes the following sections:

Overview of Web Services

A Web service is a self-contained application that can be described, published, and invoked over a network, such as a corporate intranet or the Internet. Because you access Web services using standard Web protocols such as Extensible Markup Language (XML) and HTTP, the diverse and heterogeneous applications on the Web (which typically already understand XML and HTTP) can access Web services and communicate with each other automatically.

Major benefits of Web services include:

  • Interoperability among distributed applications that span diverse hardware and software platforms

  • Easy, widespread access to applications through firewalls using Web protocols

  • A cross-platform, cross-language data model (XML) that facilitates developing heterogeneous distributed applications

Anatomy of a Web Service

Web services are characterized by three factors:

  • What they do (the business functionality they expose)

  • How they can be accessed (the set of published interfaces necessary to use the exposed functionality)

  • Where they are (the Web site which exposes that functionality)

What the Web service can do (that is, the functionality it implements) is described in a standard XML vocabulary called Web Services Description Language (WSDL). For example, a banking Web service may implement functions to check an account, print a statement, and deposit and withdraw funds. These functions are described in a WSDL file that any consumer can invoke to access the banking Web service. As a result, a consumer does not have to know anything more about a Web service than the WSDL file that describes what it can do.

A Web service client (or consumer)--such as, a desktop application or a Java Platform, Enterprise Edition portlet-- invokes a Web service by submitting a request in the form of an XML document to the Web service. The Web service processes the request and returns the result to the Web service client in an XML document.

The Web service client can send a request in the form of a Simple Object Access Protocol (SOAP) message. SOAP is an XML messaging framework designed to allow heterogeneous applications to exchange structured information in a distributed environment. In turn, the Web service processes the request and returns the response in a SOAP message.

You can also develop Representational State Transfer (REST) Web services, or "RESTful" Web services. REST describes any simple interface that transmits data over a standardized interface (such as HTTP) without an additional messaging layer, such as SOAP. REST provides a set of design rules for creating stateless services that are viewed as resources, or sources of specific information, and can be identified by their unique URIs. A client accesses the resource using the URI, a standardized fixed set of methods, and a representation of the resource is returned. The client is said to transfer state with each new resource representation.

To secure the message exchange, the Web service may require credentials to access the service, for example a username and a password, or encrypt the response.

Web Service Standards

Web services rely on a set of XML-based industry standards, including the following:

  • XML, a data format that allows uniform communication between Web services consumers and Web services providers

  • XML Schema, a framework that describes XML vocabularies used in business transactions

  • SOAP, a protocol for exchanging structured information in the implementation of Web services

  • WSDL, an XML-based language providing a model for describing Web services

  • WS-Policy, a framework that provides a flexible and extensible grammar for describing the capabilities, requirements, and general characteristics of Web services using policies

Roadmap for Web Services

Table 11-1 Roadmap for Web Services

Major Task Subtasks and Additional Information

Learning more about WebLogic Web Services

Using the samples (for WebLogic Web service developers)

Developing Web services using JAX-WS

Developing RESTful Web services

Developing Web services using JAX-RPC

Deploying and administering WebLogic Web services

Securing WebLogic Web services

Interoperability with WebLogic Web services