Doing E-Business with XML Schemas and SOAP

Web Languages
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

The Extensible Markup Language (XML) is a simple text format that enables the sharing of information in this new age of internetworked machines. The XML standard was adopted just 2 years ago, and it's already reshaping the data processing world. XML's great influence in the computer environment is due to its independence from any particular programming language or operating system. The development of the XML standard was the result of great cooperation among longtime market rivals. XML has the full support of IBM, Microsoft, Sun, Lotus, Oracle, and virtually any other household computer name you can think of.

XML by itself is simple, which was an important reason for its quick adoption. This simplicity makes XML very versatile. XML can be used to exchange information among different subsystems of an application and to separate content from presentation, and it's becoming the preferred format for sharing information between business partners. While XML's simplicity makes it versatile, it also makes it insufficient on its own for some of the most sophisticated tasks put to it.

Of the many technologies emerging around XML, two will have the greatest impact on the way business applications are developed. They are the XML schemas and the Simple Object Access Protocol (SOAP).

What Is XML?

Through XML, a document’s sections and individual values are tagged with meaningful names. Figure 1 shows a simplistic invoice expressed in XML. In very crude terms, the document looks like a multiformat file. It contains five record formats: Header, Contact, Item, Footer, and Address. Each individual field is tagged with a meaningful name. While the document is easy to read, it doesn’t describe how invoices are formatted; it’s only an example.

XML documents don’t have records and fields. Instead, they are composed of elements and attributes. Each tag marks an element. In the invoice example, Contact is one such element. The values within a tag are its attributes. In the example, the element Contact has the attributes Name, Company, and Email. The extensibility of XML (the X in XML) is what makes the language so attractive. Developers define the attributes and elements of a particular kind of document; that is, they define the vocabulary and syntax of the document.

The XML Standard

When the XML standard was first adopted, it included a language for specifying some of the rules governing certain classes of documents. This language, called the document type definition (DTD), is often used to define document types. However, DTD has proven to be too limited to describe the most complex relationships among elements of a document.

The organization responsible for Internet standards, the World Wide Web Consortium (W3C), acknowledges the DTD's limitations on its W3C XML Activity page. It states the following:

While XML 1.0 supplies a mechanism (DTD) for declaring constraints on the use of markup, automated processing of XML documents requires more rigorous and comprehensive facilities in this area... The [W3C] XML Schema Working Group is addressing means for defining the structure, content and semantics of XML documents.

XML Schemas

The new means for defining what documents should look like are XML schemas. You can preview the implementation included with Microsoft Internet Explorer 5.0, which provides a technology preview of XML schemas.

The Internet Explorer component that deals with XML is the ActiveX Microsoft XML (MSXML). It can be used as part of the browser or as a standalone component of any language that is capable of using ActiveX components.

Whenever two entities share information via XML documents, they must agree on the format of such documents. Both the consumer and the producer of the documents must have access to the description of the format—the XML schema being used.

Figure 2 shows a portion of the XML schema that describes the invoice in Figure 1. The main XML tags that describe a document are Schema, AttributeType, ElementType, element, and attribute.

Schema

The first tag, Schema, marks the document as a schema and names the schema being defined. XML schemas use namespaces to qualify their vocabulary.

AttributeType

The AttributeType tag defines the characteristics of attributes that are part of elements. Attributes include name and type, and may be required or optional.

ElementType

The ElementType tag defines an element. It can specify a scalar or a structure composed of other elements and attributes. A well-formed XML document has one root element, such as Invoice.

Elements and Attributes

Within ElementType tags, you specify elements and attributes valid for the type. For example, Invoice contains Header, ItemList, Footer, InvoiceTo, and DeliverTo.

Additional schema-related syntax examples are included in the original article, but omitted here for brevity.

SOAP

SOAP defines a mechanism for passing commands and parameters between HTTP clients and servers. SOAP uses XML as the format for marshaling data and HTTP as its transport protocol.

A sample SOAP request is shown in Figure 3.

The Future of Developing on the Web

Creating and using Web services will continue to improve. Tools and languages will increasingly support automatic schema exposure and message handling.

For more information:

  • BizTalk: www.biztalk.org
  • W3C XML Activity: www.w3.org/XML/Activity.html
  • W3C XML Schema: www.w3.org/XML/Schema.html
  • XML Schema Developer's Guide

LATEST COMMENTS

Buyer's Guide Search

Popular Products

Nexus Portal
43,977
IPCharge
38,956
IPCharge
38,956
Barcode400
37,629
WebSmart ILE and PHP
37,111
Presto
36,878
Catapult
35,742
Catapult
35,742
EDI Software - EZConnect iSeries EDI/XML Software Solutions
25,562
EDI Software - EZConnect iSeries EDI/XML Software Solutions
25,562

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: