Why XML is important to Web services

Source: Internet
Author: User
Tags format interface soap web services
Web|web Service |xml

Web services are often described from the perspective of its component technology. SOAP, UDDI, WSDL, XML, and HTTP each form part of the Web services system, and they all play an important role. Let's look at the contribution of XML technology to the Web services platform.


Standardization


Standardization is one of the XML features compared to other Web services technologies. XML provides a standard format for transferring data between Web Service applications. The World Wide Web Consortium manages XML standards and publishes them to global XML technology providers, which ensures compatibility of XML products.

In addition to XML engines and products, there are XML grammars (grammar). Each XML syntax is a standard way to format data in a particular problem area. By following and adopting XML grammars, you can standardize the data formats for communication between two applications.


Interface protocol

Programmers often refer to an interface as a protocol when programming it. From a programmatic point of view, interfaces provide a programming structure without exposing implementations. If you use a DTD (a file type definition) and an outline (schema), then XML has a similar attribute. DTDs and outlines are used to describe the structure of XML documents and the rules for establishing XML documents. You can use one (or more) related DTDs (or outlines) to organize such a collection of rules, which we call XML grammars.

XML grammars can be used not only to standardize communication between applications, but also to provide an interface protocol for developers. In other words, when a developer creates an application that needs to use an XML document structure, he doesn't need to know how the document is implemented (that is, the actual XML document). DTDs and outlines describe the structure of the document, which can be used as an interface protocol for development. Any changes to the DTD also change the protocol.


Simplified

Another important aspect of an XML document is its simplified nature. I did not imply that the implementation of XML is simple, but that the concepts and general methods of XML are simple. For example, XML is based on a text document, which simplifies the process of opening an XML document and viewing its contents.

It is also important to simplify the Web services model with XML. Web services are naturally more complex than individual XML. Assuming that XML is as complex as CORBA and that other Web services technologies have the same complexity, Web services technology becomes unwieldy. But by using simple building blocks, such as XML, SOAP, and so on, we can control the complexity of Web services within a tolerable range, so that the applications created with it are not difficult to control.


Packaging

Encapsulation is one of my favorite XML features, especially when developing Web services. In essence, encapsulation refers to the concept of obtaining one or more data blocks (chunks of) and assembling them into a simple object (rather than several independent objects). Encapsulation is similar to a collection (aggregation), but there is an important difference between them, that is, encapsulation generally means that it has no external dependencies.

You can create XML documents with external dependencies, but in the transactional Web service model (transactional Web services models), it makes sense to use encapsulation. By designing an XML solution that wraps dependencies, you can generally eliminate problems in transaction processing (transactions). It is harmful to force a method to locate external data in a transaction and make it consistent with XML data, especially if external data is often changed. If you encapsulate data into an XML grammar, you get the right data for the transaction.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.