SOAP server in 30 seconds
Posted by John Kleijn • Friday, January 2. 2009 • Category: PHPI sometimes get the feeling that some PHP developers think SOAP is hard to use. When in most cases, nothing could be further from the truth.
require_once './UniverseGateway.php';
$server = new SoapServer('test.wsdl');
$server->setClass('UniverseGateway');
$server->handle();
Voila, a SOAP server. Ok, there's a little more to it, but really there doesn't absolutely need to be, especially using the right tools.
A SOAP client is equally simple:
$client = new SoapClient('test.wsdl');
$client->invokeThisOperationOnTheServer('withMe', 'andMeAsWell');
Of course there are some options which I've ignored, but this is the gist of it.
Watch this desktop video capture as I create a service using Zend Studio that gives the answer to the ultimate question in 30 seconds. Ok, so in fur real time it took me just under two minutes, that doesn't mean I have to torture you any longer than 30 seconds.
Update: the screencast got scrambled in the transporter buffer..



ShareThis