Anatomy of a Web Service: XML, SOAP and WSDL for Platform-independent Data Exchange | 2 | WebReference

Anatomy of a Web Service: XML, SOAP and WSDL for Platform-independent Data Exchange | 2


[prev]

Anatomy of a Web Service: XML, SOAP and WSDL for Platform-independent Data Exchange [con't]

Extensible Mark-up Language (XML)

The entire Web service concept is based on XML. Which begs the question, what is XML? XML is an eXtensible Mark-up Language that enables you to identify and organize your information in a more accurate and flexible way. It is called extensible because it does not have a fixed format. An example of a mark-up language that has a fixed format is HTML, which is an SML or Single Markup Language. The difference between the two is that with XML you can define any element and call it whatever you like, while with HTML you already have pre-defined elements and attributes. For instance, to make text appear italic in a Web browser, you use the <em></em> tags. Every modern browser will know how to display that text. Without pre-defined tags like this, XML allows you to define your own tags to both display and format text. This flexibility is exactly what Web services use to make it both platform and implementation independent. XML is most widely used in RSS documents, which are used for news syndication on the Internet. Below is an example of an XML document:

When unformatted, the XML looks like this in Internet Explorer:

Figure 1: Unformatted XML File

When formatted with an XSL stylesheet it looks like this:

Figure 2: XML File Formatted with XSL

The stylesheet has the following code:

Conclusion

We have covered a few open protocols and standards in this article that should give you enough information to understand how a Web service application works. To put these topics in action, the next article will demonstrate how to build a Web service.

Original: June 7, 2010


[prev]