The eBay Web Service gets the current price of any eBay auction:
<?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/"/>
</input>
<output name="getCurrentPriceResponse">
<soap:body use="encoded" namespace="urn:xmethods-EbayWatcher" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="eBayWatcherService">
<documentation>Checks current high bid for an eBay auction</documentation>
<port name="eBayWatcherPort" binding="tns:eBayWatcherBinding">
<soap:address location="http://services.xmethods.net:80/soap/servlet/rpcrouter"/>
</port>
</service>
</definitions>
If you invoke wsdl2java on the above WSDL document, you can run this client to interact with the service:
package eBay;
import javax.naming.InitialContext;
public class Client
{
public static void main(String[] args) throws Exception
{
| String auc = args.length > 0 ? args[0] : "1239594630";
| InitialContext ctx = new InitialContext();
| EBayWatcherService service = (EBayWatcherService)
| ctx.lookup("xmlrpc:soap:eBay.EBayWatcherService");
| EBayWatcherPortType eBay = service.getEBayWatcherPort();
| System.out.println("price on " + auc + " is $" +
| eBay.getCurrentPrice(auc));
}
}
Please refer to the README file for details on how to build and run the example.
Copyright © 2003, 2004 Novell, Inc. All rights reserved. Copyright © 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.