#! /bin/ksh

# Shell script to run web services PHP client demos using PEAR::SOAP.

# just for cleanup
rm -rf google.php temperature.php

if [ "$1" == "clean" ]
then
	exit
fi

echo "\n!!! Accessing xmethods.net service, without using proxy"

echo "\n=== Gets current temperature for zip code"
./ws-temp-no-proxy.php 07746

PHP_DIR=/usr/lib/php

echo "\n!!! Accessing google.com service, using proxy generation"

echo "\n=== Does google search, should find a couple of matches"
/usr/bin/php -q $PHP_DIR/SOAP/tools/genproxy.php \
	http://api.google.com/GoogleSearch.wsdl > ./google.php
./search1.php '"guide to software development kits on sco systems"'

echo "\n!!! Accessing xmethods.net service again, with proxy "

echo "\n=== Gets current temperature for zip code"
/usr/bin/php -q $PHP_DIR/SOAP/tools/genproxy.php \
    http://www.xmethods.net/sd/2001/TemperatureService.wsdl > ./temperature.php
./ws-temp.php 14853

