Using Java to Access a WSDL Document

The last thing we will cover is building a simple Java object to query a WSDL document. We currently use the JDOM Java XML APIs. However, sometime in early- to mid-2002, this task will be made simpler with the JWSDL (Java API for WSDL) API. Currently, JWSDL has not been released, so we will have to use a little more sweat to build our process. You can find information about JWSDL at http://jcp.org/jsr/detail/110.jsp.

The first step is to build a Java class to parse the WSDL document and make the Web service calls. The class to do this is shown in Listing 14.10, and should be saved as webapps/xmlbook/WEB-INF/classes/xmlbook/chapter14/BuzzServiceCall.java.

Listing 14.10. A Class to Read the WSDL File and Make ...

Get JSP™ and XML Integrating XML and Web Services in Your JSP™ Application now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.