Welcome Guest, Not a member yet? Register   Sign In
SoapServer and CodeIgniter - Help!
#1

[eluser]naruto[/eluser]
Hi all,

I need help with webservices using PHP SOAP and Code Igniter. I am trying to setup a SOAP server but I confused on how to add a functions using addFunction.

Below is my code:
Code:
<?php
class Simple_server extends Controller {

    function Simple_server() {
        parent::Controller();
    }

    function echoo($echo) {
        return "ECHO: ".$echo;
    }

    function index() {
        $server = new SoapServer(null, array('uri' => "urn://tyler/res"));
        $server->addFunction('echoo');
        $server->handle();
    }
}
?>

Above code returned below error when called by a SOAP client:

Quote:[Thu Dec 06 03:07:22 2007] [error] [client x.x.x.x] PHP Fatal error: Function 'echoo' doesn't exist in /www/application/controllers/simple_server.php on line 20
Any idea how to use addFunction properly with CodeIgniter?

Btw, below code works, but I have to put a function inside function.
Code:
<?php
class Simple_server extends Controller {

    function Simple_server() {
        parent::Controller();
    }

    function index(){

        function echoo($echo) {
            return "ECHO: ".$echo;
        }

        $server = new SoapServer(null, array('uri' => "urn://tyler/res"));
        $server->addFunction('echoo');
        $server->handle();
    }
}
?>
Thank you




Theme © iAndrew 2016 - Forum software by © MyBB