Back to index

d-push  2.0
Public Member Functions | Private Attributes
Webservice Class Reference

List of all members.

Public Member Functions

 Handle ($commandCode)
 Handles a webservice command.

Private Attributes

 $server

Detailed Description

Definition at line 45 of file webservice.php.


Member Function Documentation

Webservice::Handle ( commandCode)

Handles a webservice command.

Parameters:
int$commandCodepublic
Returns:
boolean
Exceptions:
SoapFault

Definition at line 57 of file webservice.php.

                                         {
        if (Request::GetDeviceType() !== "webservice" || Request::GetDeviceID() !== "webservice")
            throw new FatalException("Invalid device id and type for webservice execution");

        if (Request::GetGETUser() != Request::GetAuthUser())
            ZLog::Write(LOGLEVEL_INFO, sprintf("Webservice::HandleWebservice('%s'): user '%s' executing action for user '%s'", $commandCode, Request::GetAuthUser(), Request::GetGETUser()));

        // initialize non-wsdl soap server
        $this->server = new SoapServer(null, array('uri' => "http://z-push.sf.net/webservice"));

        // the webservice command is handled by its class
        if ($commandCode == ZPush::COMMAND_WEBSERVICE_DEVICE) {
            ZLog::Write(LOGLEVEL_DEBUG, sprintf("Webservice::HandleWebservice('%s'): executing WebserviceDevice service", $commandCode));

            include_once('webservicedevice.php');
            $this->server->setClass("WebserviceDevice");
        }
        $this->server->handle();

        ZLog::Write(LOGLEVEL_DEBUG, sprintf("Webservice::HandleWebservice('%s'): sucessfully sent %d bytes", $commandCode, ob_get_length()));
        return true;
    }

Here is the call graph for this function:


Member Data Documentation

Definition at line 46 of file webservice.php.


The documentation for this class was generated from the following file: