WSDL Tutorials - Herong's Tutorial Examples - Version 2.02, by Dr. Herong Yang
Configuring and Testing SOAP Extension
This section provides a tutorial example on how to configure and test SOAP Extension with my Hello Web service.
Once PHP 5.3.1 is installed, I need to turn on the SOAP Extension with these steps:
1. If \local\php\php.ini does not exist, create it by copying the file \local\php.ini-production.
2. Edit \local\php\php.ini to set these configuration settings:
... extension_dir = "C:\local\php\ext" ... extension=php_soap.dll ...
3. Creating a testing PHP program, SOAP_Hello.php:
<?php # SOAP_Hello.php # Copyright (c) 2009 by Dr. Herong Yang, herongyang.com # All rights reserved $client = new SoapClient( "http://www.herongyang.com/Service/Hello_WSDL_11_SOAP.wsdl"); echo $client->Hello("Hello from client."); ?>
4. Run the test program:
C:\herong\>\local\php\php SOAP_Hello.php Hello from server - herongyang.com.
This is super cool! You can call a Web service in two lines with PHP SOAP Extension.
Last update: 2009.
Table of Contents