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.

4

No such property. The property that the client requested does not exist on the specified object.

5

Read-only property. The set request cannot be completed because the specified property is read only.

6

Wrong number of parameters. The request did not specify the correct number of parameters. Either more or fewer parameters are needed.

7

Wrong parameter type. One or more of the parameters given is of the wrong type.

8

Security violation. The method is not allowed in RPC.


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/fireworks/8/fwextending/fw_03_c8.htm