O'Reilly logo

Enterprise JavaBeans, Fourth Edition by Richard Monson-Haefel, Bill Burke, Sacha Labourey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

WSDL 1.1

WSDL (Web Service Description Language) is an XML markup language used to describe a web service. WSDL is programming language-, platform-, and protocol-agnostic. The fact that WSDL is protocol-agnostic means it can describe web services that use protocols other than SOAP and HTTP. This ability makes WSDL very flexible, but it has the nasty side effect of making WSDL abstract and difficult to understand. Fortunately, the WS-I Basic Profile 1.0 endorses only SOAP 1.1 over HTTP, so we’ll discuss WSDL as if that’s the only combination of protocols supported.

Imagine that you want to develop a web service component that implements the following interface:

public interface TravelAgent extends java.rmi.Remote {
    public String makeReservation(int cruiseID, int cabinID, 
                                                 int customerId, double price)
    throws java.rmi.RemoteException;
}

Any application should be able to invoke this method using SOAP, regardless of the language in which it was written or the platform on which it is running. Since other programming languages don’t understand Java, we have to describe the web service in a language they do understand: XML. Using XML, and specifically the WSDL markup language, we can describe the type of SOAP messages that must be sent to invoke the makeReservation( ) method. A WSDL document that describes the makeReservation( ) method might look like this:

<?xml version="1.0"?> <definitions name="TravelAgent" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required