GLUE java2wsdl Tool

The GLUE platform includes a java2wsdl command-line tool for transforming Java services into WSDL descriptions. The command-line usage is as follows:

usage: java2wsdl <arguments>

where valid arguments are:
  classname                     name of java class
  -d directory                  output directory
  -e url                        endpoint of service
  -g                            include GET/POST binding
  -m map-file                   read mapping instructions
  -n namespace                  namespace for service
  -r description                description of service
  -s                            include SOAP binding
  -x command-file               command file to execute

Complete information on each argument is available online within the GLUE User Guide at http://www.themindelectric.com/products/glue/releases/GLUE-1.1/docs/guide/index.html. For now, we will focus on the most basic arguments.

For example, consider the PriceService class in Example 6-4. The service provides a single getPrice( ) method.

Example 6-4. PriceService.java
package com.ecerami.soap.examples; import java.util.Hashtable; /** * A Sample SOAP Service * Provides Current Price for requested Stockkeeping Unit (SKU) */ public class PriceService { protected Hashtable products; /** * Zero Argument Constructor * Load product database with two sample products */ public PriceService ( ) { products = new Hashtable( ); // Red Hat Linux products.put("A358185", new Double (54.99)); // McAfee PGP Personal Privacy products.put("A358565", new Double (19.99)); } /** * Provides Current Price for requested SKU * In a real-setup, this method would connect to * a price database. If SKU ...

Get Web Services Essentials 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.