In steps 3 and 4 of this series, we looked at XSLT and XML parsing technologies—the building blocks for working with XML. Now let’s use these technologies and move in a new direction: web services. Our objective is to set up ZwiftBooks with a web service so that client computers around the world can query the ZwiftBooks database and get price and delivery time based on their location. Our options include using REST and SOAP to set up the web service. Along the way we’ll run into some opposition from our IT manager, so keep on your toes.
What Is a Web Service?
Web services represent a fundamental change in how information is exchanged and delivered over the Web. Instead of humans generating web requests via browsers, web services allow computers to reach out to other computers to exchange information (see Figure 1).
"But wait a minute," I can hear the cynics saying. "Hasn’t data always been exchanged over networks? Back in the 1980s, IBM had SNA, the Object Management Group gave us CORBA, Microsoft came up with COM and DCOM, and numerous industry groups created data exchange using the EDI data standard."
True, all of the above are examples of computer-to-computer communication. But in these instances, the communication happens only after all the data formats, connections, and protocols are ironed out in advance, to make sure that the platforms sitting at each end of the wire understand each other.
The compelling story behind web services is how many of the previous details we can ignore, thanks to the XML technology family, HTTP, and the Web (the de facto universal network).
Figure 1 The conventional web vs. web services.