Sharing XML with Web Services

A Web Service is essentially a service provider of information as a service, over a local area network (LAN), wide area network (WAN), or even the Internet at large. Many applications are written for the Internet. An internal company application running on a LAN or WAN (internal company intranet site) is essentially a small-scale , secure version of a globally available Internet application. When you log into your bank account over the Internet you are using an Internet application. But your bank account website could also be pictured as a WAN usable by the customers of the bank. Behind the banking application are web servers and databases running in the background. You cant see all that stuff. All those server computers are transparent to you as you reconcile your bank statement online with your checkbook in your hand. The result is that you are running an application to a companys computers using a Web Service. Additionally, the information transfers that occur when you click buttons , and even pay bills online, could cause all sorts of things to happen. For instance, the transfer of information between your computer in your home, and to and from your banks web servers, could all be handled using XML data.

Essentially, a Web Service is, by definition, a service that provides information over the Internet. So, a Web Service provides a service to the Internet. The application you use to reconcile your bank statement, running in your browser at home, is therefore a Web Service. What needs to be discussed here is what this Web Service comprises:

  • Network Transfer Protocol:  HTTP protocol is the most widely used.

  • Transformation processing:  Change data from one format to another.

  • Web Services protocol:  Allows for semantic interpretation of XML documents.

The HTTP Protocol

There needs to be some kind of network transfer protocol that is used to manage the physical sending of data along cables. By definition, a protocol is a procedure or method of regulating transfers between computers across some type of network (including the Internet). In other words, all computers can understand messages sent and received because they are all sending and receiving messages using the same format and structure (the protocol).

The HTTP protocol is used to open connections, send and receive messages between computers, and finally close the connection. HTTP is the most commonly used component for transfer of information over the Internet. It makes perfect sense for XML data transfers to stick with HTTP. The philosophy behind using HTTP is that it makes XML more acceptable because HTTP largely already exists. Also there wont be any issues with essential security hoops such as firewalls.

Transformation Processing

When transferring XML data, it is not absolutely essential to change the structure of an XML document, as it is transferred between different nodes in a network. For example, transferring an XML document from an Oracle to a SQL Server database could involve writing out from an XML data type on one database, transferring it, and then inserting that same XML document into another XML data type on the second database server. It is more likely that transformations will occur when attempting to map XML data to local database table structures, or locally running applications. Locally running applications and localized transformations are specific to a particular server environment, such as a company. Thus, localized functions have little to do with the physical transfer of data.

Web Services Protocol

A Web Services protocol is a specialized protocol (it could even be called a language) that can be universally interpreted by any computer. And this applies to any computer that understands XML data. An application or web server serves up information to end users, looking at the results of queries in their browsers. There is a slight difference between a web server and a Web Service. The intention of a Web Service is that of serving information to other computers, as opposed to end users. Thus, the purpose of a Web Service protocol is to send data in the form of messages between computers. There is no human interface. There are no people involved.

A very simple example of a Web Service protocol is a spoken language translation protocol, often sent to a specialized service dedicated specifically as a translation service. A protocol would apply a really simple structure to a text message sent in one language, and returned in a different language. The response could also be served up to a browser on the Internet. The syntax for an example protocol sent could be something like this:

   TranslateThisPlease { text string, source string, target string }   

The actual translation request could be something like this:

   TranslateThisPlease { "Hello", "English", "French" }   

The response would be:

   "Bonjour"   

Which, if you dont know, is Hello in French.

Obviously if the protocol is improperly coded, the message is not understood . This is because it does not fit in with the Web Service protocol requirements for the translation service. For the following example, an error would be returned:

   TranslateThisPlease { "Hello", "English" }   

The preceding error would be caused because the translation service does not know what language to translate the response into.

In the next example, the content will not be understood because there is no such language as Gobbledegook:

   TranslateThisPlease { "Hello", "English", "Gobbledegook" }   

A Web Services protocol is a format applied to messages sent between computers. In the preceding example, that format is exclusive to a translation service. There are obviously many other similar Web Services on the Internet that function in the same way. However, other services do different things for example, a newsfeed that sends information to a browser. A newsfeed contains completely different information and structure to that of a translation service. An example of a newsfeed is the scrolling text that runs across the screen on the Cable News Network news channel (CNN). How can a standard be applied to these examples, such as translation service and a newsfeed? Both Web Services have different content and structure. The answer is a protocol language or standard.

A browser understands XML. Your browser may be Internet Explorer, Netscape, or something else, depending on your operating system and preference. Once again, one of the primary purposes of XML is standardization of data. Therefore, why not try to introduce a standard method of interpreting the semantics of that data. One of the most effective of these protocols is called Simple Object Access Protocol (SOAP).

This leads to the next section, which covers application of semantics (meaning) of XML data being transferred between any computers.



Beginning XML Databases
Beginning XML Databases (Wrox Beginning Guides)
ISBN: 0471791202
EAN: 2147483647
Year: 2006
Pages: 183
Authors: Gavin Powell

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net