The following is an excerpt from Chapter 14 of Oracle Database Programming Using Java and Web Services by Kuassi Mensah. Mensah is currently Group Product Manager within the Java and Web services products group, part of Oracle's server technologies. Mensah holds an MS in computer sciences and a post-graduate degree from the Programming Institute of University of Paris VI.
Click here to read the full chapter.
Web services and SOA for DBAs, data architects and others
The promise of Web services is simplified interfaces for application-to-application interaction in heterogeneous and distributed environments. This chapter describes the key technologies that enable Web services (i.e., XML, WSDL, SOAP, UDDI) and then peeks at the bigger picture, the service-oriented architecture (SOA). After reading this chapter, you will be well armed to understand database Web services, our final destination.
Web Services 101
In traditional Web interactions, humans interact with applications through browsers, which interpret HTML to produce graphical displays and accept user inputs. Web services, by contrast, allow application-to-application interaction through XML messages irrespective of the implementations, the location and the platforms of the client and the server application modules. The World Wide Web Consortium (W3C) defines Web services as "software applications or components identified by a URL that describes their interfaces (i.e., services or operations they furnish) and their binding in XML, and that can be accessed by client-applications using XML messages and Internet protocols."
The key benefits are interoperability (language/platform neutral); simpler, flexible and dynamic integration (provision to support new protocols, dynamic service discovery and binding, defined interfaces foster composition); automation (application-to-application interaction, services orchestration/ workflow); and time to market (reuse of existing applications). These benefits are made possible by the standards technologies (formats, protocols and description) that compose the Web services stack. We can distinguish the core Web services technologies and then the infrastructure/ deployment requirements, as well as higher-level technologies.
Core Web services technologies
The core technologies that make up Web services are XML, SOAP, WSDL and UDDI.
The eXtended Markup Language (XML) is the lingua franca of Web services (and many other technologies); it serves as the base language for type definition, service description, data format, data transfer, messaging, discovery, security and so on. Web services requesters and providers exchange information using XML documents, which are formatted according to either XML Document Type Definition (DTD) rules or XML schema rules (XSD).
As briefly described in Chapter 8, XML Schema Definition (XSD) is a W3C recommendation, an alternative to DTD, for describing the structure, content and semantics of XML documents, thereby allowing all parties involved to have a common and exact understanding of the document in question. The XSD defines which elements the document may contain, their attributes and their relationship. Because XML does not come with predefined tags, the role of XML namespaces and XML schemas is integral for a shared understanding of the document.
An XML document contains:
- A prolog or processing instruction, which starts and ends with "?" into brackets, and are the only "predefined" tags in XM; everything else is self-described, which is the "eXtensibility" in XML.
- XML namespace (xmlns), namespace instance (xmlns:xsi) and an association of the schema and the instance (xsi:schemaLocation). According to the W3C, "XML namespaces provide a simple method for qualifying element and attribute names used in Extensible Markup Language documents by associating them with namespaces identified by URI references."
- A root element (address), which may have attributes and a cascade of subelements:
<element> <subelement> <field1>.....</field1> </subelement> </element>
Here is a basic XML document representing an address:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?> <! This is a comment --> <Address xmlns=http://www.basicxml.org/AddressDoc xmlns:xsi=https://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation= "http://www.basicxml.org/AddressDoc file:./AddressDoc.xsd"> <Street>24 Benin Drive</Street> <City>San Francisco </City> <State>California</State> <Country>USA</Country> </Address>
XML defines simple types, such as string, Base64Binary, hexBinary, integer, date, positiveInteger, genativeInteger, nonNegatveInteger, nonPositiveInteger, decimal, boolean, time, dateTime, duration, date, Name, QNane, anyURI, ID, IDREF and so on. XML also allows user-defined complex types.
XML documents can be processed and consumed directly by an application as a character stream or serialized and parsed by XML serializers and parsers (e.g., DOM, SAX, StAX).
XML documents can also be displayed using XSL and XSL transformers (XSLT) and style sheets. There is a whole range of XML standards, APIs, tools, editors and utilities. However, their coverage is beyond the scope of this book. There are tons of online resources, tutorials and FAQs about XML, such as the following:
The Web Services Description Language (WSDL) is an XML language, based on a general-purpose XML schema, for describing how to access a service, including:
- Messages and their style (i.e., document versus RPC)
- Bindings of abstract operations and messages to a concrete network protocol
- Format of messages that a service can receive (see SOAP messages formats discussion)
- Supported operations, their parameters and return types
- Location of the service
The rest of this chapter contains more information on WSDL, SOAP, REST and UDDI, as well as an overview of service-oriented architecture (SOA). Click here to read the full chapter.
Printed with permission from Digital Press, a division of Elsevier. Copyright 2006. Oracle Database Programming Using Java and Web Services by Kuassi Mensah. For more information about this book and other similar titles, please visit elsevier.com.
This article originally appeared on SearchOracle.com.