I’ve created a DataSource for connecting to a WSDL server and post/get data.
But, I don’t know how to use it in a controller? with a MySQL database (I mean I need both of them, a soap and a database is needed.)
If I put this in my model, it will use my datasource; but I think it won’t use its mysql table…:
public $useTable = false;
public $useDbConfig = 'mydatasource';
How?
You can use $this->Modelname->setDataSource(‘default’) and setDataSource(‘mydatasource’) to switch between the two sources on the fly.
But you also need to change between using a table, and not using a table, i use the following code to switch between a no-table source, and mysql: