[eluser]Unknown[/eluser]
[quote author="stevefink" date="1214806178"]Hi all,
I'm trying to build my SOAP abstraction layer into an existing CI application. I'm having a bit of a problem with scope in this case. When I try to access my dbmodel, which would normally be done with something such as: $this->dbmodel->method(), it cannot find the Dbmodel object. A code snippet looks like the following:
Code:
class Soap extends Controller {
function Soap()
{
parent::Controller();
$this->load->model('Dbmodel', 'dbmodel');
// SOAP server handlers initialized here.
$server = new SoapServer("mywsdl.wsdl");
$server->setObject($this);
$server->handle();
exit; // This is required, otherwise CI sends additional headers to the client breaking everything in the way. Still can't find where in CI these headers originate from, but that's a different problem.
}
function foo($stuff)
{
$pretty = $this->dbmodel->please_do_stuff($sid);
}
}
When foo() is executed, I get something such as the following:
Call to undefined method Dbmodel::please_do_stuff()
I'm under the impression that I'm within the context of the Soap class, and not the controller instance. Would be curious as to how to switch the context so I can properly access the database.
Anyone have similar woes?
Thanks![/quote]
Hi:
I'm a new Soap developer, I'm trying to develop a Web Services with CI, but I don't know how define the <soap:address location="..."/> on the WSDL file.