82
Chapter 3: Cross-Product Extensions
Parameters
Parameters are simply data nodes with an
order
attribute. The
order
attribute identifies the
order in which the parameters should be processed for the server. In this way, the RPC client can
use any XML client library to build parameters in any order, and the RPC server retains the
correct parameter order. The first parameter should have the
order
attribute set to 0; the second,
to 1; and so on, as in this example:
<string order="1" value="bob" />
The
set
operation requires only one parameter, and the
func
operation may have zero or
more parameters.
RPC server XML replies
After the RPC server processes an XML request, it packages the result as an XML fragment and
sends it back to the client. If an error occurred during processing, the server returns an error code
in the result XML. Otherwise, the reply node contains a single data node with the result of the
operation. If the request doesn’t require a return value, the reply node contains either a single void
data node or no children nodes.
For example, here is a successful reply:
<return><string value="file://hd/foo/stuff/mydoc.png" /></return>
Here is a successful reply with a server object:
<return><obj value="23467" class="FireworksDocument" /></return>
Note:
When the server returns a server object, it automatically retains the object on the client's behalf.
That is, the object returned to the client is not destroyed until the client releases it with a
release
request, or until the client disconnects from the server. Therefore, the client should release a server
object as soon as the client has finished sending requests related to that object (when the client is
done “using” the object).
Error codes
If the server encounters an error when processing a request, the reply node (with the node name
return
) contains at most one
error
attribute, as in this example:
<return error="5" />
The
error
attribute can contain one of the values listed in the following table.
Error code Description
0
No error occurred, and the request completed successfully. The client should never
receive an error attribute with this value. If no error occurred, then no error attribute will
be present.
1
An unknown, generic error occurred. The RPC server could not make enough sense of
the request to give a specific error. Check the name of the XML nodes and attributes.
2
No such object, invalid object ID. The object specified by the client does not exist or the
object ID is invalid.
3
No such method. The method that the client requested does not exist on the
specified object.
Summary of Contents for DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER
Page 1: ...Extending Fireworks...
Page 4: ...4 Contents...
Page 8: ...8 Chapter 1 Extending Fireworks Overview...
Page 102: ...102 Chapter 4 Auto Shapes...