Start here
This tutorial is for developers who want to understand how to integrate Web services into an XSLT-based application. It explains how to
- Send and receive SOAP messages
- Transform them with XSLT
- Integrate them with another document using the XSLT stylesheet's
document()function - Get the stylesheet to send an e-mail to an administrator if there's a problem with the Web service
In previous parts of this series, you were introduced to the fictional MindMap Research Team, which has been using XSLT as an analysis tool because of its flexibility and platform independence. In this final part of the series, the team uses XSLT as a way to integrate its existing data with data provided by a Web service. Specifically, for each individual in their recent Wisdom Study, they will pull a list of books sold by Amazon.com relating to the subject's field of interest. Along the way, the tutorial covers the following:
- How SOAP-based Web services work
- Using HTTP to send and receive SOAP messages
- Using XSLT to transform a SOAP message received through HTTP
- Integrating data from a static file with Web service data within a single stylesheet
- Dynamically calling Web service data within a stylesheet
- Sending an e-mail to an administrator
- Detecting a problem within a Web service response
- Automatically alerting administrators to problems from within the stylesheet
This tutorial assumes that you are familiar with the basic principles of XML and XSLT. You do not have to be familiar with Web services. It is helpful to be familiar with the Java language, but the concepts are applicable to any programming language.
To follow along with the tutorial, you'll need to have the following tools installed and working.
For the command-line version (as opposed to the servlet version), you will need:
- Java 2 Standard Edition 1.4 or another XSLT engine: The sample code uses Java 1.4 (available at http://java.sun.com/j2se/1.4.2/download.html), which has XSLT built in. If you're using Java 1.3 or earlier, you can download the Xalan XSLT processor, available at http://xml.apache.org/xalan-j/index.html. You also have the option to use another language and another engine, but you'll have to adapt those sections of code accordingly.
- An XSLT development environment, and a Java development environment: You can develop Java code and XSLT using a text editor, but you will find it easier if you use an IDE such as WebSphere Studio Application Developer. You can download a trial version at http://www.ibm.com/developerworks/websphere/downloads/WSADsupport.html.
- A servlets engine: This tutorial demonstrates an XSLT transformation in a Java servlet, so you'll need a servlet engine such as Tomcat, available from http://jakarta.apache.org/tomcat/index.html. If you're using WebSphere Studio Application Developer, however, you can skip this step and use the WebSphere Test Environment.
- The JavaMail API: The last step in this tutorial involves sending an e-mail using a Java class. To make this work, you must download both the JavaBeans Activation Framework (http://java.sun.com/products/javabeans/glasgow/jaf.html) and the JavaMail API (http://java.sun.com/products/javamail/).

