[ Team LiB ] Previous Section Next Section

Web Service Technologies

Web Services rely on several pluggable technologies to seamlessly provide functionality to their clients and to invoke other Web Services. Understanding these technologies is important to Web Service developers. That means you can use any number of technologies, or other technologies that are not discussed in this chapter, and you'd use only those technologies you need. (However, it is generally recognized that SOAP is the base technology for Web Services.) None of the Web Services technologies use special tools; everything is text-based. This is a big difference from CORBA, in which you have to use special software and the whole flock of features and libraries. This section discusses these technologies.

Simple Object Access Protocol

Simple Object Access Protocol (SOAP) is employed for exchanging information using XML as a base language. For more information about XML, please refer to Chapter 29, "WebLogic Server and XML Technologies." SOAP was originally co-authored by Microsoft, DevelopMentor and UserLand Software. Other companies such as IBM and Lotus have worked on later versions of SOAP. A SOAP message is defined to have three parts, as shown in Figure 30.1. The different parts of a SOAP message are

  • SOAP envelope A container for the SOAP header and body. It also defines the processing rules for the SOAP message.

  • SOAP header An optional component of a SOAP message. It contains security and transaction management type details.

  • SOAP body This component contains the data or the actual contents of the message. The SOAP body can contain any sort of messages. However, it generally contains data related to an operation to execute on a Web Service and the parameters to pass to that operation.

Figure 30.1. Structure of a SOAP message.


Listing 30.1 shows an example of a SOAP message. You can see the SOAP header and body with some dummy information.

Listing 30.1 A Sample SOAP Message
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  <m:GetWeather xmlns:m="Some-URI">

SOAP isn't tied to any specific protocol, but it is usually discussed in relation to HTTP. If HTTP is used to send and receive SOAP messages, they can pass through firewalls that are usually configured to allow port 80 (HTTP) requests. This is important because it allows applications to communicate without requiring port security to be loosened. However, it also means that Web Services must be carefully written to guard against SOAP messages that can misuse Web Services or otherwise harm its runtime environment, whether intentionally or not. Although security has not been a focal point of SOAP, WebLogic Server provides its own security services for Web Services that will be discussed later in this chapter. More information about SOAP can be found at http://www.w3.org/TR/SOAP/.

SOAP messages come in two types: RPC-oriented (Remote Procedure Call) and document-oriented. RPC-oriented SOAP messages contain the names of specific Web Service operations and their input and output parameters. Document-oriented SOAP messages contain only data. A Web Service operation receives this message and then applies its business logic, depending on the contents of the XML. RPC-oriented SOAP messages are more typical and Web Service operations expecting document-oriented SOAP messages must be explicitly configured this way.

WebLogic Server 8.1 provides an implementation of SOAP 1.1, SOAP 1.2, and SOAP with Attachments API for Java (SAAJ) specifications. SOAP messages can become large and complicated, but as we'll see, WebLogic Server automates the creating and processing of SOAP messages most of the time. Web Service developers are then left with more time to write business logic and can let WebLogic Server take care of the underlying plumbing.

Web Service Definition Language

Web Service Definition Language (WSDL) is an XML-based specification for defining attributes about Web Services, including the operations it supports, the input and output parameters of those operations, and the URL that the Web Service is connected to. WSDL files are usually quite verbose and complex. Thankfully, under most circumstances, the tools in WebLogic Server generate the WSDL file for us.

WebLogic Server 8.1 supports WSDL 1.1. More information about WSDL can be found at http://www.w3.org/TR/wsdl.

Universal Description, Discovery and Integration

Universal Description, Discovery and Integration (UDDI) is a specification that standardizes how to register Web Services in a registry and how to find other Web Services. Public registries allow organizations to advertise the Web Services they offer. WebLogic Server 8.1 supports UDDI 2.0 and comes with its own UDDI registry. Additionally, it comes with a UDDI directory explorer to search private and public UDDI registries and a UDDI client API to programmatically search through these registries. More information about UDDI is available at http://www.uddi.org.

    [ Team LiB ] Previous Section Next Section