SOAP server in 30 seconds

Posted by John Kleijn • Friday, January 2. 2009 • Category: PHP

I 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..

0 Trackbacks

  1. No Trackbacks

0 Comments

Display comments as (Linear | Threaded)
  1. No comments

Add Comment

You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.
Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA


Antiquities and such