SOAP made simple again with CakePHP. Build a classmap of the wsdl file.

Installs: 23

Dependents: 0

Suggesters: 0

Security: 0

Stars: 22

Watchers: 2

Forks: 5

Open Issues: 1


dev-master 2012-11-20 15:08 UTC

This package is not auto-updated.

Last update: 2024-05-11 11:06:51 UTC


This plugin iterates over a SOAP API and generates a (cake)php file that you can include in your projects that contains all the API's methods & objects as PHP classes. These classes can then be used by this plugin's datasource to talk with the service.


You'll need the XSLTProcessor. On Ubuntu you'd install that as such:

aptitude install php5-xsl


cd app/Plugin
wget https://github.com/ceeram/wsdl/zipball/master -o wsdl.zip
unzip wsdl.zip
mv ceeram-wsdl-* Wsdl && rm -f wsdl.zip

or git clone, from your app dir:

git clone git://github.com/ceeram/wsdl.git Plugin/Wsdl


In app/Config/bootstrap.php add:


Command line:

cake Wsdl.Wsdl

and follow the instructions

create a config in database.php like the example:

public $soapservice = array(
	'datasource' => 'Wsdl.WsdlSource',
	'wsdl' => 'http://domain.com/service.asmx?WSDL',
	'lib' => 'ServiceClassMap',

Set wsdl and lib to the values you entered and got back in the shell.

Add public $useTable = false; and public $useDbConfig = 'soapservice'; to your model.


If the web service is protected via Basic authentication, you could supply the credentials as follows:

public $soapservice = array(
	'datasource' => 'Wsdl.WsdlSource',
	'wsdl' => 'http://domain.com/service.asmx?WSDL',
	'lib' => 'ServiceClassMap',
	'login' => 'phally',
	'password' => 'awesome',