Notes
Saturday May 10, 2003
Web services tested with PHPObject
This is a non-exhaustive list of the web services I have tested with PHPObject. You may find them useful. Please feel free to post any other useful web services you have tested. Thanks!
AirportWeather
********************************************* Included as an example in the WebServicesConnectivity AddOn
BabelFish Translation
// wsdl location
mySvc = new PHPObject("http://www.xmethods.net/sd/2001/BabelFishService.wsdl");
// parameters (you can pass directly in the operation below)
transmode = "en_zh";
source = "string of text you want translated";
// operation
mySvc.BabelFish(
"translationmode",transmode,
"sourcedata",source
);
// wsdl location
mySvc = new PHPObject("http://www.xmethods.net/sd/2001/BabelFishService.wsdl");
// parameters (you can pass directly in the operation below)
transmode = "en_zh";
source = "string of text you want translated";
// operation
mySvc.BabelFish(
"translationmode",transmode,
"sourcedata",source
);
********************************************* Translation translationmode ----------- ---------------- English -> Chinese "en_zh" English -> French "en_fr" English -> German "en_de" English -> Italian "en_it" English -> Japanese "en_ja" English -> Korean "en_ko" English -> Portugese "en_pt" English -> Spanish "en_es" French -> English "fr_en" Chinese -> English "zh_en" German -> English "de_en" Italian -> English "it_en" Japanese -> English "ja_en" Korean -> English "ko_en" Portugese -> English "pt_en" Russian -> English "ru_en" Spanish -> English "es_en"
Barnes & Noble Book Price
// wsdl location
mySvc = new PHPObject("http://www.xmethods.net/sd/2001/BNQuoteService.wsdl");
// parameters (you can pass directly in the operation below)
isbn = "0618162216"; // isbn of the book
// operation
mySvc.getPrice(
"isbn",isbn
);
// wsdl location
mySvc = new PHPObject("http://www.xmethods.net/sd/2001/BNQuoteService.wsdl");
// parameters (you can pass directly in the operation below)
isbn = "0618162216"; // isbn of the book
// operation
mySvc.getPrice(
"isbn",isbn
);
Currency Exchange Rate
// wsdl location
mySvc = new PHPObject("http://www.xmethods.net/sd/2001/CurrencyExchangeService.wsdl");
// parameters (you can pass directly in the operation below)
country1 = "united states"; // 1 unit of this currency
country2 = "australia"; // converts to how many of this currency?
// operation
mySvc.getRate(
"country1",country1,
"country2",country2
);
// wsdl location
mySvc = new PHPObject("http://www.xmethods.net/sd/2001/CurrencyExchangeService.wsdl");
// parameters (you can pass directly in the operation below)
country1 = "united states"; // 1 unit of this currency
country2 = "australia"; // converts to how many of this currency?
// operation
mySvc.getRate(
"country1",country1,
"country2",country2
);
********************************************* Valid country names (case insensitive): Check here for the list
Delayed Stock Quote
// wsdl location
mySvc = new PHPObject("http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl");
// parameters (you can pass directly in the operation below)
symbol = "IBM"; // stock ticker symbol
// operation
mySvc.getQuote(
"symbol",symbol
);
// wsdl location
mySvc = new PHPObject("http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl");
// parameters (you can pass directly in the operation below)
symbol = "IBM"; // stock ticker symbol
// operation
mySvc.getQuote(
"symbol",symbol
);
********************************************* 20 minute delayed stock quote
Domain Name Checker
// wsdl location
mySvc = new PHPObject("http://services.xmethods.net/soap/urn:xmethods-DomainChecker.wsdl");
// parameters (you can pass directly in the operation below)
domainname = "domain.com"; // the domain name you want to check
// operation
mySvc.checkDomain(
"domainname", domainname
);
// wsdl location
mySvc = new PHPObject("http://services.xmethods.net/soap/urn:xmethods-DomainChecker.wsdl");
// parameters (you can pass directly in the operation below)
domainname = "domain.com"; // the domain name you want to check
// operation
mySvc.checkDomain(
"domainname", domainname
);
********************************************* This service returns 'available' or 'unavailable' for registration.
GlobalWeather
// wsdl location
mySvc = new PHPObject("http://live.capescience.com/wsdl/GlobalWeather.wsdl");
// parameters (you can pass directly in the operation below)
stationcode = "AMS"; // 'AMSTERDAM', IATA/FAA code
// operation
mySvc.getWeatherReport(
"code",stationcode
);
// wsdl location
mySvc = new PHPObject("http://live.capescience.com/wsdl/GlobalWeather.wsdl");
// parameters (you can pass directly in the operation below)
stationcode = "AMS"; // 'AMSTERDAM', IATA/FAA code
// operation
mySvc.getWeatherReport(
"code",stationcode
);
********************************************* This returns an object, so make sure you traverse into the properties to get the results. For more info, please refer to CapeScience website. Other operations available in this web service: getStation() isValidCode() listCountries() searchByCode() searchByCountry() searchByLocation() searchByName() searchByRegion()
Google Web API
The tutorial is here.
The tutorial is here.
MSN Messenger Status
// wsdl location
mySvc = new PHPObject("http://www.net-aholic.de/cgi-bin/msn/imstatus.wsdl");
// parameters (you can pass directly in the operation below)
handle = "bill@hotmail.com"; // the username of the MSN Messenger user
// operation
mySvc.Status(
"UserName",handle
);
// wsdl location
mySvc = new PHPObject("http://www.net-aholic.de/cgi-bin/msn/imstatus.wsdl");
// parameters (you can pass directly in the operation below)
handle = "bill@hotmail.com"; // the username of the MSN Messenger user
// operation
mySvc.Status(
"UserName",handle
);
********************************************* This service returns 'online' or 'offline' only; doesn't show the other status such as 'busy', 'away', etc. If the person just got online it takes a while to register him as 'online'.
Romulan Numbers XLII
// wsdl location
mySvc = new PHPObject("http://www.ebob42.com/cgi-bin/Romulan.exe/wsdl/IRoman");
// parameters (you can pass directly in the operation below)
Int = 42; // integer to convert a roman number
Rom = "XV"; // string to convert to digital number
// operation (converts digital number to roman number)
mySvc.IntToRoman(
"Int",Int
);
// operation (converts roman number to digital number)
mySvc.RomanToInt(
"Rom",Rom
);
// wsdl location
mySvc = new PHPObject("http://www.ebob42.com/cgi-bin/Romulan.exe/wsdl/IRoman");
// parameters (you can pass directly in the operation below)
Int = 42; // integer to convert a roman number
Rom = "XV"; // string to convert to digital number
// operation (converts digital number to roman number)
mySvc.IntToRoman(
"Int",Int
);
// operation (converts roman number to digital number)
mySvc.RomanToInt(
"Rom",Rom
);
Site Inspector
// wsdl location
mySvc = new PHPObject("http://www.flash-db.com/services/ws/siteInspect.wsdl");
// parameters (you can pass directly in the operation below)
siteURL = "www.mydomain.com";
// operation
mySvc.doSiteInspect(
"username","Any",
"password","Any",
"siteURL", siteURL
);
Posted by sunny at May 10, 2003 12:36 PM
// wsdl location
mySvc = new PHPObject("http://www.flash-db.com/services/ws/siteInspect.wsdl");
// parameters (you can pass directly in the operation below)
siteURL = "www.mydomain.com";
// operation
mySvc.doSiteInspect(
"username","Any",
"password","Any",
"siteURL", siteURL
);
********************************************* This service returns an object, so make sure you traverse into the properties to get the results.
|
Comments
|
