Sorry, I missed part of the message:

Would you just specify the token here:

client = new Zend_XmlRpc_Client('http://localhost:10088/xmlrpcserver');
$timesheets = $client->getProxy('timesheets');
$resp = $timesheets->addHours($token, $hours);


Thanks

---------- Forwarded message ----------
From: Daniel Latter <[email protected]>
Date: 6 September 2010 16:40
Subject: Zend_XmlRpc token passing
To: Zend Framework General <[email protected]>


hi,

RE: Matthew Weier O'Phinney

On a Nabble post you refer to a piece of code that enables the passing
of a token:

 class My_XmlRpc_Request extends Zend_XmlRpc_Request_Http
   {

       public function __construct()
       {
           parent::__construct();

           if ($this->getMethod() != 'login') {
               $params = $this->getParams();
               $token  = array_shift($params);
               $this->setParams($params);

               // Verify the token, and then add it to the registry...
               Zend_Registry::set('token', $token);
           }
       }
   }

I am correct in thinking that all service method(s) will stay the
same, i.e. - have no reference to the token?

so like this:

/**
        * Add timesheet hours for a candidate
        *
        * @param array Hours for a working week
        * @return array
        */
       public function addHours($hours) {

               $timesheetService = new Service_Timesheet();
               $resp = $timesheetService->addCandidateTimesheetHours($hours);

               return $resp;
       }


and NOT like this:

/**
        * Add timesheet hours for a candidate
        *
        * @param string token
        * @param array Hours for a working week
        * @return array
        */
       public function addHours($token, $hours) {

               $timesheetService = new Service_Timesheet();
               $resp = $timesheetService->addCandidateTimesheetHours($hours);

               return $resp;
       }


TIA

Daniel.

Reply via email to