User Guide

102 Cross-Product Extensions
RPC client XML requests
The XML request contains the following four pieces of information for Fireworks:
The type of operation to perform
The name of the operation to perform
The object on which the operation is performed
Any parameters the operation needs
Logically, requests contain two parts: the envelope and the parameters. The envelope specifies
the the requested operation (for instance,
get or set) and the object that the operation is
performed on. The parameters (strings, integers, arrays, and so on) specify how the operation
happens. The envelope tag contains the parameter tag, as follows:
<envelope><parameter /></envelope>
The RPC client sends the following four types of requests, specified in the XML tag name of
the envelope:
The get operation retrieves the current object properties. The get operation can contain
only the
obj and name attributes and no subelements. In the following example, the client
requests the value of the
appDir property of the object whose ID is 1:
<get obj="1" name="appDir" />
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 the
following 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>
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" />
NOTE
XML requests are specially formatted XML document fragments, not full XML
documents. XML requests are sent to the server in UTF-8 encoding and terminated with
the null (0) character.