CodeIgniter and SOAP Server (context of $this object) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: CodeIgniter and SOAP Server (context of $this object) (/showthread.php?tid=9548) |
CodeIgniter and SOAP Server (context of $this object) - El Forum - 06-29-2008 [eluser]stevefink[/eluser] 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 { 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! CodeIgniter and SOAP Server (context of $this object) - El Forum - 06-29-2008 [eluser]Seppo[/eluser] Judging by the error message, $this->dbmodel is having a Dbmodel object as it should... Does Dbmodel has the please_do_stuff method? It seems like a stupid question, but the object is an instance of the expected class, so that is the only thing I can think that can fail CodeIgniter and SOAP Server (context of $this object) - El Forum - 07-01-2008 [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 { 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. |