User Guide

Cross-product architecture 79
The RPC client sends four types of requests, specified in the XML tag name of the envelope:
get
The
get operation retrieves the current object properties. The get operation can contain only
the
obj and name attributes and no subelements. In this example, the client requests the value
of the
appDir property of the object whose ID is 1:
<get obj="1" name="appDir" />
set
The
set operation sets the object properties. The set operation can contain only the obj and
name attributes and exactly one parameter. The parameter must be the same data type as the
data type of the property being set, or Fireworks will return an error. In this example, the client
sets the property of “name” (a string providing a directory path) to the value
file://hd/foo/
stuff
:
<set obj="1" name="appDir"><string order="1" value="file://foo/stuff" /></
set>
func
The
func operation calls a method that operates on the specified object. The number and type
of parameters vary according to the method called by the
func operation. In the following
example, the client calls the
undo method to operate on the object with object ID 1:
<func obj="1" name="undo" />
release
The
release operation informs the server that the client has finished working on the specified
object. A
release request must specify only an obj attribute and no subelements. For
example, in this example the client tells the server that it is has finished working on the object
with ID 1:
<release obj="1" />
Note: Each type of request requires an obj attribute, and all but the release request require a name
attribute. Requests can be only of types
get, set, func, or release. The RPC server rejects all
other types.
Object IDs
RPC clients reference objects on the server by their object IDs. Because all functionality is
exposed by means of objects, every client request must contain a valid object ID. When an object
that can be accessed through RPC is created, it is assigned a unique object ID. The object retains
that ID for its entire lifetime. This happens for all RPC server objects, whether they are created
directly by an RPC call or by an internal Fireworks function. The object IDs maybe re-used after
the corresponding object is destroyed.
Note: The object ID number should be treated as a string data type that could contain non-numbers,
(do not treat the object ID as an integer data type).