ZendAMF how to get the service request name?

149 Views Asked by At

I am using the Zend Framework - ZendAMF library. I am trying to figure out how to get the name of the service being called.

For example, a basic Zend AMF PHP script might look like this (per these docs):

$server = new Zend_Amf_Server();
$server->addDirectory(dirname(FILE) .'/../services/');
$response = $server->handle(); 
echo $response;

When an application calls this script, it calls a service, loaded from the services directory.

I am trying to get the name of the service in THIS script. Is this possible? Looking at the zend code, it looks like they load in the raw post data, then decode that amf data and request. However, I can not see how I can access the request information to pull out the service name.

I was hoping for something like $server->getRequestServiceName(), or to drill in to an object and pull it out.

1

There are 1 best solutions below

1
RockyFord On

you should be able to call:

$server->getRequest(); 

at the appropriate place to see what is in the request object or:

$server->getResponse();

if you need to see exactly what your application responded with.

Depending on exactly which tidbit of info you need, one of these objects should have it.