SoapSource, a SOAP Client Datasource for CakePHP

Update: Fixed some stupid typo’s in the documentation.
I’ve published my SOAP Datasource on Github, you can find the sourcecode in the ‘soapsource‘ repository.
SoapSource allows you to connect with SOAP servers that support Wsdl. I also started implementing functionality for non Wsdl SOAP servers, but I don’t think I will continue on this.
SoapSource now supports non wsdl servers also, you can add ‘uri’ and ‘location’ parameters to your datasource configuration now.
In order to use the Datasource you will need to have PHP5 installed with the SOAP extension.

Here’s how you use it:

Copy the soap_source.php file to your app/models/datasources/ directory
Add a configuration to your database.php in app/config/
var $soap = array(
‘datasource’ => ’soap’,
‘wsdl’ => ‘http://localhost/soapservice.wsdl’, // wsdl mode
‘location’ => ”, // Required for non wsdl mode
‘uri’ => ” // Required for non wsdl mode
);
Then in your model set:
var $useDbConfig = ’soap’;
var $useTable = false;
And you’re ready to go.
In your controller you can now use
$this->Model->query(‘SoapMethod’, array(‘mySoapParams’));
or
$this->Model->SoapMethod(array(‘mySoapParams’));