This Web Service returns information about traffic on any CA highway.
<?xml version="1.0"?> <definitions name="CATrafficService" targetNamespace="http://www.xmethods.net/sd/CATrafficService.wsdl" xmlns:tns="http://www.xmethods.net/sd/CATrafficService.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="getTrafficRequest"> <part name="hwynums" type="xsd:string"/> </message> <message name="getTrafficResponse"> <part name="return" type="xsd:string"/> </message> <portType name="CATrafficPortType"> <operation name="getTraffic"> <input message="tns:getTrafficRequest" name="getTraffic"/> <output message="tns:getTrafficResponse" name="getTrafficResponse"/> </operation> </portType> <binding name="CATrafficBinding" type="tns:CATrafficPortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="getTraffic"> <soap:operation soapAction="" /> <input name="getTraffic"> <soap:body use="encoded" namespace="urn:xmethods-CATraffic" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output name="getTrafficResponse"> <soap:body use="encoded" namespace="urn:xmethods-CATraffic" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> <service name="CATrafficService"> <documentation>Provides information on California Highway Conditions.</documentation> <port name="CATrafficPort" binding="tns:CATrafficBinding"> <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 traffic; import javax.naming.InitialContext; public class Client { public static void main(String[] args) throws Exception { | String hwy = args.length > 0 ? args[0] : "101"; | InitialContext ctx = new InitialContext(); | CATrafficService service = (CATrafficService) | ctx.lookup("xmlrpc:soap:traffic.CATrafficService"); | CATrafficPortType traffic = service.getCATrafficPort(); | System.out.println(traffic.getTraffic(hwy)); } }
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.