Basic WSDL Example: XMethods eBay Price Watcher Service

Before moving on to more complicated WSDL examples, let’s examine another relatively simple one. Example 6-3 provides a WSDL file for the XMethods eBay Price Watcher Service. The service takes an existing eBay auction ID, and returns the value of the current bid.

Example 6-3. eBayWatcherService.wsdl (reprinted with permission of XMethods, Inc.)
<?xml version="1.0"?> <definitions name="eBayWatcherService" targetNamespace= "http://www.xmethods.net/sd/eBayWatcherService.wsdl" xmlns:tns="http://www.xmethods.net/sd/eBayWatcherService.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <message name="getCurrentPriceRequest"> <part name="auction_id" type = "xsd:string"/> </message> <message name="getCurrentPriceResponse"> <part name="return" type = "xsd:float"/> </message> <portType name="eBayWatcherPortType"> <operation name="getCurrentPrice"> <input message="tns:getCurrentPriceRequest" name="getCurrentPrice"/> <output message="tns:getCurrentPriceResponse" name="getCurrentPriceResponse"/> </operation> </portType> <binding name="eBayWatcherBinding" type="tns:eBayWatcherPortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="getCurrentPrice"> <soap:operation soapAction=""/> <input name="getCurrentPrice"> <soap:body use="encoded" namespace="urn:xmethods-EbayWatcher" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> ...

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.