Skip Headers
Oracle® Application Server Web Services Developer's Guide
10g Release 2 (10.1.2)
Part No. B14027-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

1 Web Services Overview

This chapter provides an overview of Web Services. Chapter 2, "Oracle Application Server Web Services" describes the Oracle Application Server Web Services features, architecture, and implementation.

This chapter covers the following topics:

1.1 What Are Web Services?

Web Services consist of a set of messaging protocols, programming standards, and network registration and discovery facilities that expose business functions to authorized parties over the Internet from any web-connected device.

This section covers the following topics:

1.1.1 Understanding Web Services

A Web Service is a software application identified by a URI, whose interfaces and binding are capable of being defined, described, and discovered by XML artifacts. A Web Service supports direct interactions with other software applications using XML based messages and internet-based products.

A Web Service does the following:

  • Exposes and describes itself – A Web Service defines its functionality and attributes so that other applications can understand it. By providing a WSDL file, a Web Service makes its functionality available to other applications.

  • Allows other services to locate it on the web – A Web Service can be registered in a UDDI Registry so that applications can locate it.

  • Can be invoked – Once a Web Service has been located and examined, the remote application can invoke the service using an Internet standard protocol.

  • Web Services are of either request and response or one-way style, and they can use either synchronous or asynchronous communication. However, the fundamental unit of exchange between Web Services clients and Web Services, of either style or type of communication, is a message.

Web Services provide a standards based infrastructure through which any business can do the following:

  • Offer appropriate internal business processes as value-added services that can be used by other organizations.

  • Integrate its internal business processes and dynamically link them with those of its business partners.

1.1.2 Benefits of Web Services

The benefits for enterprises seeking to develop and use Web Services to streamline their business processes include the following:

  • Support for open Internet standards. Oracle supports SOAP, WSDL, and UDDI as the primary standards to develop Web Services. Web Services developed with Oracle's products can inter-operate with those developed to Microsoft's .NET architecture.

  • Simple and productive development facilities. Oracle provides developers with an easy-to-use and productive environment for developing Web Services using a programming model that is identical to that for J2EE applications.

  • Mission critical deployment facilities. Oracle provides a mission-critical platform to deploy Web Services by unifying the Web Services and J2EE runtime infrastructure. Oracle Application Server Web Services provide optimizations to speed up Web Services responses, to scale Web Services on single CPUs or multiple CPUs, and to provide high availability through fault tolerant design and clustering.

1.1.3 About the Web Services e-Business Transformation

The move to transform businesses to e-Businesses has driven organizations around the world to begin to use the Internet to manage corporate business processes. Despite this transformation, business on the Internet still functions as a set of local nodes, or Web sites, with point-to-point communications between them. As more business moves online, the Internet should no longer be used in such a static manner, but rather should be used as a universal business network through which services can flow freely, and over which applications can interact and negotiate among themselves.

To enable this transformation, the Internet needs to support a standards-based infrastructure that enables companies and their enterprise applications to communicate with other companies and their applications more efficiently. These standards should allow discrete business processes to expose and describe themselves on the Internet, allow other services to locate them, to invoke them once they have been located, and to provide a predictable response.

Web Services drive this transformation by promising a fundamental change in the way businesses function and enterprise applications are developed and deployed.

This e-Business transformation is occurring in the following two areas:

  • Business Transformation with Web Services

  • Technology Transformation with Web Services

1.1.3.1 About Business Transformation with Web Services

Web Services enables the next-generation of e-business, a customer-centric, agile enterprise that does the following:

  • Expands Markets - Offers business processes to existing and new customers as services over the Internet, opening new global channels and capturing new revenue opportunities.

  • Improves Efficiencies - Streamlines business processes across the entire enterprise and with business partners, taking action in real-time with up-to-date information.

  • Reaches Suppliers and Partners - Creates and maintains pre-defined, systematic, contractually negotiated relationships and dynamic, spot partnerships with business partners who are tightly linked within supply chains.

1.1.3.2 About Technology Transformation with Web Services

Web Services enables enterprise applications with the following technology transformations:

  • Development and Deployment – Web Services can be developed and deployed quickly and productively.

  • Locating Services – Web Services allow applications to be aggregated and discovered within Internet portals, enterprise portals, or service registries which serve as Internet Yellow Pages.

  • Integrating Services – Web Services allow applications to locate and electronically communicate with other applications within an enterprise and outside the enterprise boundaries.

  • Inter-Operating Services – Web Services allow applications to inter-operate with applications that are developed using different programming languages and following different component paradigms.

1.2 Overview of Web Services Standards

This section describes the Internet standards that comprise Web Services, including:

Figure 1-1 shows a conceptual architecture for Web Services using these standards.

Figure 1-1 Web Services Standards

Standards-based components for Web Services implementation.
Description of the illustration aswsv002.gif

1.2.1 SOAP Standard

The SOAP is a lightweight, XML-based protocol for exchanging information in a decentralized, distributed environment. SOAP supports different styles of information exchange, including: Remote Procedure Call style (RPC) and Message-oriented exchange. RPC style information exchange allows for request-response processing, where an endpoint receives a procedure oriented message and replies with a correlated response message. Message-oriented information exchange supports organizations and applications that need to exchange business or other types of documents where a message is sent but the sender may not expect or wait for an immediate response. Message-oriented information exchange is also called Document style exchange.

SOAP has the following features:

  • Protocol independence

  • Language independence

  • Platform and operating system independence

  • Support for SOAP XML messages incorporating attachments (using the multipart MIME structure)


See Also:

http://www.w3.org/TR/SOAP/ for information on the SOAP 1.1 specification

1.2.2 Web Services Description Language (WSDL)

The Web Services Description Language (WSDL) is an XML format for describing network services containing RPC-oriented and message-oriented information. Programmers or automated development tools can create WSDL files to describe a service and can make the description available over the Internet. Client-side programmers and development tools can use published WSDL descriptions to obtain information about available Web Services and to build and create proxies or program templates that access available services.


See Also:

http://www.w3.org/TR/wsdl for information on the Web Services Description Language (WSDL) format.

1.2.3 Universal Description, Discovery, and Integration (UDDI)

The Universal Description, Discovery, and Integration (UDDI) specification is an online electronic registry that serves as electronic Yellow Pages, providing an information structure where various business entities register themselves and the services they offer through their WSDL definitions.

There are two types of UDDI registries, public UDDI registries that serve as aggregation points for a variety of businesses to publish their services, and private UDDI registries that serve a similar role within organizations.


See Also:

http://www.uddi.org for information on Universal Description, Discovery and Integration specifications.

1.3 SOAP Message Exchange and SOAP Message Encoding

The SOAP standard defines a lightweight, XML-based protocol for exchanging information in a decentralized, distributed environment. SOAP supports different styles of information exchange, including: Remote Procedure Call, RPC Style, and Message-oriented exchange, or Document Style. SOAP Messages, whether RPC Style or Document Style use a certain encoding, as specified with the encodingStyle attribute specified for SOAP message elements. This section describes these SOAP message features, in the following sections:

1.3.1 SOAP Message Components

Each SOAP message is a transmission between a SOAP sender and a SOAP receiver. Each SOAP message consists of a SOAP envelope containing two sub-elements, a Header and a Body. The SOAP Header is optional. The children of the SOAP header are called header blocks; each header block represents a logical grouping of data. The SOAP Body is a mandatory element within a SOAP message. This is where the end-to-end information conveyed in a SOAP message is carried. The choice of what data is placed in a header block and what data goes in the SOAP Body element are decisions that are taken at the time that an application is designed.

Using Oracle Application Server Web Services, developers determine if an implementation supports RPC Style or Document Style messages. Developers write the appropriate application logic and the WebServicesAssembler configuration files for the implementation.

1.3.2 Working With RPC Style SOAP Messages

Oracle Application Server Web Services supports two types of SOAP message exchanges: RPC Style exchanges and Document-Style exchanges. RPC Style exchanges represent exchanges that can be modeled as remote procedure calls (RPC); these are used when there is a need to model a certain programatic behavior, with the exchanged messages conforming to a well-defined signature for the remote call and its return. Using RPC Style messages, SOAP specifies the form of the SOAP message body.

RPC style information exchange allows for request-response processing, where an endpoint receives a procedure oriented message and replies with a response message. Using the RPC style SOAP message exchange, the contents of the SOAP message body conform to a structure that specifies a procedure and includes set of parameters, or a response, with a result and any additional parameters. The SOAP message in the body is an XML document, but it is XML document that conforms the limitations specified in the SOAP specification.

Example 1-1 shows a SOAP RPC Style request that includes the ChargeReservation method with several parameters. Example 1-2 shows the SOAP RPC Style response message that includes the ChargeReservationResponse, with a "Response" string appended.

Example 1-1 SOAP RPC Style Request Message

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <SOAP-ENV:Body>
      <ns1:helloWorld xmlns:ns1="urn:oracle-j2ee-ws_example-StatelessExample"
           SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <param0 xsi:type="xsd:string">Wendy</param0>
      </ns1:helloWorld>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Example 1-2 SOAP RPC Style Response Message

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <SOAP-ENV:Body>
      <ns1:helloWorldResponse 
           xmlns:ns1="urn:oracle-j2ee-ws_example-StatelessExample"
           SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
             <return xsi:type="xsd:string">Hello World, Wendy</return>
      </ns1:helloWorldResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

1.3.3 Working With Document Style SOAP Messages

Oracle Application Server Web Services supports two types of SOAP message exchanges: RPC Style exchanges and Document-Style exchanges. Document-style exchanges, also called message-oriented exchanges, model exchanges where XML documents are exchanged, where the exchange patterns are defined in the sending and the receiving applications. For Document Style messages, SOAP places no constraints on how the document sent in the SOAP message body is structured, the application, or an externally specified XML schema determines the structure of the XML document that is sent in the body of the SOAP message.

Message-oriented information exchange supports organizations and applications that need to exchange business or other types of documents where a message is sent but the sender may not expect or wait for an immediate response. Message-oriented information exchange is also called Document style SOAP message exchange. Document -style messages model exchanges where XML documents are exchanged, where the semantics of the exchange patterns are defined in the sending and the receiving applications.

Example 1-3 shows a sample Document Style SOAP message that is sent from a client to an Oracle Application Server Web Services document style service. The client sends an XML document that contains employee records with elements including name, emp_id, department, and contact information. A web service that processes this XML document to produce a phone listing may supply an XML document that contains only the name and phone number elements.

Example 1-3 Document Style SOAP Message

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<organisation>
  <employee>
   <name>Bob</name>
   <emp_id>1234</emp_id>
   <department>hr</department>
   <contact>
      <phone>827 644 5674</phone>
      <email>bob@organisation.com</email>
   </contact>
  </employee>
  <employee>
   <name>Susan</name>
   <emp_id>2434</emp_id>
   <department>it</department>
   <contact>
      <phone>827 644 5674</phone>
      <email>Susan@organisation.com</email>
   </contact>
  </employee>
</organisation>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Example 1-4 Document Style SOAP Message Processed by a Web Service

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
   <employee>
      <name>Bob</name>
        <phone>827 644 5674</phone>
      <name>Susan</name>
        <phone>827 644 5674</phone>
   </employee>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>