This section describes a tutorial example, GetTemp.php, on how to use PHP SOAP client interface.
To show you an example of how PHP SOAP Extension can be used in a SOAP client application, here is my
first SOAP PHP program, GetTemp.php
<?php # GetTemp.php
# Copyright (c) 2005 by Dr. Herong Yang
#
$client = new SoapClient
("http://www.xmethods.net/sd/2001/DemoTemperatureService.wsdl");
echo("\nReturning value of getTemp() call: ".
$client->getTemp("12345"));
?>
Run it while your connected to the Internet. You will get:
>php GetTemp.php
Returning value of getTemp() call: 52
Very nice. This confirms that:
PHP SOAP Extension is easy to use. Two statements are enough to call a SOAP service.
Your PHP SOAP Extension is installed correctly and working.
PHP SOAP Extension supports WSDL.
www.xmethods.net is doing a great job for offering this demonstration SOAP service.