The WIDL Specification
by Lynn Monson


Listing One
<?XML VERSION="1.0"?>
<!DOCTYPE WIDL SYSTEM "widl.dtd">

<WIDL NAME="Quote" VERSION="2.0">

<!-- ---------------------------------------------- -->
<SERVICE NAME="StockPriceService"
 METHOD="GET"
 URL="http://quote.yahoo.com/q"
 INPUT="StockPriceServiceInput"
 OUTPUT="StockPriceServiceOutput" />

Listing Two
<BINDING NAME="StockPriceServiceInput" TYPE="INPUT">
 <VARIABLE NAME="StockSymbol" TYPE="String" FORMNAME="s" USAGE="DEFAULT" />
 <VARIABLE NAME="DesiredDetail" TYPE="String" FORMNAME="d" 
     VALUE="v1" USAGE="DEFAULT" COMMENT="Basic " />
</BINDING>


Listing Three
<BINDING NAME="StockPriceServiceOutput" TYPE="OUTPUT">
 <VARIABLE NAME="StockPrice" TYPE="String" REFERENCE=
     "doc.html[0].body[0].p[3].table[0].tr[1].td[2].text" USAGE="DEFAULT" />
</BINDING>


Listing Four
<SERVICE NAME="StockPriceService2"
 METHOD="GET"
 URL="http://fast.quote.com/fq/quotecom/quote"
 INPUT="StockPriceService2Input"
 OUTPUT="StockPriceService2Output" />

<!-- ---------------------------------------------- -->
<BINDING NAME="StockPriceService2Input" TYPE="INPUT">
 <VARIABLE NAME="StockSymbol" TYPE="String" FORMNAME=
                                             "symbols" USAGE="DEFAULT" />
</BINDING>
<BINDING NAME="StockPriceService2Output" TYPE="OUTPUT">
 <VARIABLE NAME="StockPrice" TYPE="String" REFERENCE=
             "doc.table['*Last Sale*'].tr[2].td[1].text" USAGE="DEFAULT" />
</BINDING>



Listing Five
// This is a code fragment showing the use of the StockPriceService.
try
{
    QuoteStockPriceService o = new QuoteStockPriceService(
        StockSymbol
    );
    System.out.println("StockPrice = " + o.StockPrice);
} catch (Exception e) {
        System.err.println(e);
}


2


