The Components of Caché

pdf

Available in .pdf

XML, SOAP & Web Services

XML, SOAP & Web ServicesAs enterprises strive to streamline their business processes, there is an ever-increasing push to create applications that can interact with each other. One popular approach is to have applications share data via XML and functionality via Web Services. Caché has built-in XML and Web Service capabilities, eliminating the need for a separate application server and enabling rapid development of Web Service applications.

Caché and XML

Just as HTML is an Internet-compatible mark-up language for displaying data, XML is a mark-up language for exchanging data between applications. Using XML, disparate applications (within a company, or at different enterprises) can share data over a network. The structure of XML data is hierarchical and multidimensional, making it a natural match for Caché’s multidimensional data engine.

Caché provides an easy-to-use, bi-directional interface to XML that eliminates the need for developers to manually create a “mapping layer” of processing between XML data and the database.

Exporting XML

All that is required to make a Caché class compatible with XML is to have it inherit from the %XMLAdaptor class which is included in Caché. This provides all the methods developers will need to:

  • Create either a DTD (Document Type Definition) or an XML Schema for the class. DTD’s and XML Schemas are documents that define the structure of XML data. Although Caché will automatically generate DTD’s and XML Schemas, developers who wish to customize the XML formatting of a class may do so.
  • Automatically format data (instances of the class) as XML, according to the defined DTD or Schema. Data can be served as files or on-line, for example as content within Caché Server Pages.

Importing XML

Caché comes with other classes that provide methods allowing developers to:

  • Import XML Schemas and automatically create corresponding Caché classes.
  • Import the data in XML documents as instances of Caché classes, via a simple API.
  • Parse and validate XML documents via a Caché interface to the Xerxes SAX parser.

Caché and Web Services

Web Services are a way of sharing application functionality over the Internet. As defined by the World Wide Web (W3) consortium, Web Services have a public interface described in WSDL (Web Service Definition Language), and they return an XML document formatted according to the SOAP protocol.

Caché Web Services inherit from the %SOAP.WebService class provided by InterSystems. Caché will automatically generate the WSDL descriptor for the service and, when it is invoked, send the response, appropriately formatted as SOAP/XML. In this way, any Caché method can be published as a Web Service. Existing Caché applications can easily be Web Service enabled, and new Web Service applications can be built extremely quickly.

Diagram