ZamfBrowser Documentation
ZendAMF Gateway Setup
Below is an example of a ZendAMF Gateway file set up. The highlighted lines are the important lines to implement ZamfBrowser.
<?php
// Set up debug
error_reporting( E_ALL | E_STRICT );
ini_set( "display_errors", "on" );
// Set up include path for Zend Framework
ini_set( "include_path", ini_get("include_path") . ":frameworks" );
// Zend_Amf_Server require.
require_once( "Zend/Amf/Server.php" );
// Require the ZendAmfServiceBrowser class
require_once( "browser/ZendAmfServiceBrowser.php" );
// Start Server
$server = new Zend_Amf_Server();
// Class requires.
require_once( "services/User.php" );
require_once( "services/ReturnTests.php" );
// Register Demo Classes
$server->setClass( "User" );
$server->setClass( "ReturnTests" );
// Add the ZamfBrowser service class so ZamfBrowser can retrieve method information.
$server->setClass( "ZendAmfServiceBrowser" );
// Set a reference to the Zend_Amf_Server object so ZendAmfServiceBrowser class can retrieve method information.
ZendAmfServiceBrowser::$ZEND_AMF_SERVER = $server;
// Handle ZendAMF request
echo($server->handle());
?>
ZamfBrowser Demo
There is a demo gateway that is available at http://www.zamfbrowser.org/zamf_demo/gateway.php. This URL can be used to test out how ZamfBrowser works with a ZendAMF API. You can download the ZamfBrowserDemo here. Unzip the file on your webserver and point the ZamfBrowser to the gateway.php file.
Using ZamfBrowser with the Demo gateway
When you first open ZamfBrowser, you should see a screen like below.

A dialogue will appear to add a server to the list. The server name is arbritrary for identifying the server. The Services Gateway should be the ZendAMF server endpoint. For the demo, type in http://www.zamfbrowser.org/zamf_demo/gateway.php

After clicking "Add Server" the new entry will be available in the list. Select it and click Load ZendAMF Server.

Once the server is done loading, the two drop downs next to the gateway url in the orange bar will update with all the available Classes, and their Methods. First select a Class, and then select one of its methods.

Selecting a method will update the Input panel. The first time you test a method, the parameters of the method will appear in the grid as Object types. These are not removable since they are required by the method to test. You can click on them, change their type, add new properties if they're Objects or Arrays, and edit the String values.

When you have finished editing the object you want to send to a method, simply click on the Invoke Method button to run the service test. The result will appear in the right side, where the Output panel is located. Everytime you come back to the method you tested, the last parameters will still be there.

