You are here: Recent News » Universal Remoting » Universal Remoting Service browser

 

Universal Remoting Service browser

The Universal Remoting Service browser is the first project by the Universal Remoting group. Taking the Flex 2 amfphp service browser as its base, it aims at defining a common API and frontend for service inspection and testing.

Basically, this means that the amfphp service browser will work (in a short while) with multiple backends, including SabreAMF, fluorine, and AMFRUBY. It also means that any enhancement to the service browser will benefit all of these projects. Finally, as the service browser will require AMF3 and RemoteObject support it will motivate member projects to fully support the spec.

Specification

  • Category: Servers and Remoting.
  • Audience: Developers
  • Platform: Cross-platform
  • Maturity: Alpha
  • License: BSD

Download

The Universal Remoting service browser will not be available as a separate component for download. Rather, it will be bundled with each Remoting project that supports it.

You can read and edit the evolving API on the wiki.

Usage instructions

Testing remoting methods with the service browser

The Service Browser uses the remoting gateway to present a list of service classes and their methods. By selecting one of your methods, you will be presented with a page that allows you to call it; by entering arguments and observing the output in the “results” tab below, you can test remoting methods here.

The text inputs for arguments accept arguments in JSON (JavaScript Object Notation) or “object literal” format; essentially, valid ECMAScript (JavaScript/ActionScript) syntax.

String arguments can be entered directly without requiring quote marks, and number arguments can be entered directly as well.

To pass an array as an argument, use the JSON/ECMAScript array literal syntax – comma-separated values between square brackets. For example, if the parameter expects an array of numbers, you would enter it something like:

[1, 3, 5.5, 44]  

A two-dimensional array in JSON format is entered as an array of arrays like this:

[[1, 2, 3], [5, 7, 15], [1, 7, 2]] .

Objects (such as VOs) can also be input here, using JSON/ ECMAScript object literal syntax like this:

{id: 1, label: ‘A label’, notes: ‘Some notes’}.

Objects and arrays can also be nested inside each other:

[{id: 1, label: ‘first object’}, {id: 99, label: ‘object with an array in it’, numbers: [13, 44, 97]}, {id: 34, label: ‘object with another object in it’, thing: {‘things’: 14, ‘gadgets’: 6, ‘tchockies’: 0}}]

In addition to numbers and strings, these are all valid types of arguments an AMFPHP remoting method can accept.

For more about JavaScript/ActionScript array-literal syntax and the object/associative-array duality of ECMAScript, consult your friendly neighborhood Internet.

Note that for some reason the service browser does not much care for double-quotes, so when entering object arguments, use the single-quote format for strings.

Also note that currently, although PHP supports optional arguments to a method by specifying a default value in the method signature, the service browser does not have a way to “skip” entering an argument. If you leave an input box blank, the parameter will receive an empty string.

universal_remoting/service_browser.txt · Last modified: 2007/05/13 23:04 by wadearnold