Chapter 12. Frequently Asked Questions

Table of Contents

How to send custom XML as payload of a method call
Is there any limitation on the size of the requests / responses that can be successfully sent?
My server (client) returns an error whenever the client (server) returns accented characters
How to enable long-lasting method calls
My client returns "XML-RPC Fault #2: Invalid return payload: enable debugging to examine incoming payload": what should I do?
How can I save to a file the xml of the xmlrpc responses received from servers?
Can I use the ms windows character set?
Does the library support using cookies / http sessions?

How to send custom XML as payload of a method call

Unfortunately, at the time the XML-RPC spec was designed, support for namespaces in XML was not as ubiquitous as it is now. As a consequence, no support was provided in the protocol for embedding XML elements from other namespaces into an xmlrpc request.

To send an XML "chunk" as payload of a method call or response, two options are available: either send the complete XML block as a string xmlrpc value, or as a base64 value. Since the '<' character in string values is encoded as '&lt;' in the xml payload of the method call, the XML string will not break the surrounding xmlrpc, unless characters outside of the assumed character set are used. The second method has the added benefits of working independently of the charset encoding used for the xml to be transmitted, and preserving exactly whitespace, whilst incurring in some extra message length and cpu load (for carrying out the base64 encoding/decoding).