The only useful value is currently the string 'phpvals'.
Methods `system.listMethods`, `system.methodHelp`, `system.methodSignature` and `system.multicall` are already defined
-by the server, and should not be reimplemented (see <<reserved>> below).
+by the server, and should not be reimplemented (see <<reservedmethods>> below).
==== Method signatures [[signatures]]
error messages. The xml-rpc client provided with this library can handle the specific format used by those xml comments,
and will display their decoded value when it also has been set to use an appropriate debug level.
-=== Fault reporting
+=== Fault reporting [[faults]]
In order to avoid conflict with error codes used by the library, fault codes used by your servers' method handlers should
start at the value indicated by the variable `PhpXmlRpc::$xmlrpcerruser` + 1.
`100-` XML parse errors:: Returns 100 plus the XML parser error code for the fault that occurred. The faultString returned
explains where the parse error was in the incoming XML stream.
-=== Reserved methods [[reserved]]
+=== Reserved methods [[reservedmethods]]
In order to extend the functionality offered by XML-RPC servers without impacting on the protocol, reserved methods are
supported.
if ($val) echo 'Found a value of type ' . $val->kindOf(); else echo 'Found invalid xml';
----
-=== Errors and Logging
+=== Errors and Logging [[logging]]
Many of the classes in this library by default use the php error logging facilities to log errors in case there
is some unexpected but non-fatal event happening, such as f.e. when an invalid xml-rpc request or response are received.
not support `system.multicall`, see the __demo/client/parallel.php__ example instead for how to send multiple requests
in parallel using cURL
-== Upgrading
+== Upgrading [[upgrading]]
If you are upgrading to version 4 from version 3 or earlier you have two options:
to the debugger directory: @TODO...
-== Running tests
+== Running tests [[tests]]
The recommended way to run the library's test suite is via the provided Docker containers.
A handy shell script is available that simplifies usage of Docker.
== Frequently Asked Questions [[qanda]]
-@TODO mention setting curl options directly, following http redirects, using value/req/resp->serialize...
-
-=== 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
-became later. As a consequence, no support was provided in the protocol for embedding XML elements from other namespaces
-into an xml-rpc 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 xml-rpc value, or as a base64 value. Since the '<' character in string values is encoded as '<' in
-the xml payload of the method call, the XML string will not break the surrounding xml-rpc, unless characters outside 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).
-
-=== Is there any limitation on the size of the requests / responses that can be successfully sent?
-
-Yes. But I have no hard figure to give; it most likely will depend on the version of PHP in usage and its configuration.
-
-Keep in mind that this library is not optimized for speed nor for memory usage. Better alternatives exist when there are
-strict requirements on throughput or resource usage, such as the php native xmlrpc extension (see the PHP manual for
-more information).
-
-Keep in mind also that HTTP is probably not the best choice in such a situation, and XML is a deadly enemy. CSV formatted
-data over socket would be much more efficient. Or even Googles' ProtoBuffer.
-
-If you really need to move a massive amount of data around, and you are crazy enough to do it using phpxmlrpc, your best
-bet is to bypass usage of the Value objects, at least in the decoding phase, and have the server (or client) object
-return to the calling function directly php values (see `Client::return_type` and `Server::functions_parameters_types`
-for more details, and the tips in the <<performances>> section.
-
-=== My server (client) returns an error whenever the client (server) returns accented characters
-
-To be documented...
-
-=== How to enable long-lasting method calls
-
-To be documented...
-
=== My client returns "XML-RPC Fault #2: Invalid return payload: enable debugging to examine incoming payload": what should I do?
The response you are seeing is a default error response that the client object returns to the php application when the
appropriate access rights to the web page you are requesting, or some other common http misconfiguration.
To find out what the server is really returning to your client, you have to enable the debug mode of the client, using
-`$client->setDebug(1)`;
+`$client->setDebug(1)`. You can also inspect the http connection information in `$response->httpResponse()` - see below
=== How can I save to a file the xml of the xml-rpc responses received from servers?
response on the client (e.g. malformed xml, responses that have faultCode set, etc...) now will not be flagged as
invalid, and you might end up saving not valid xml but random junk...
+=== How can I save to a file the xml of the xml-rpc requests/responses generated from the library?
+
+Classes `Request`, `Response` and `Value` all have a method `serialize()` which can be used to obtain the xml representation
+of their value.
+
+Note that, if what you want is to check with absolute certainty what is being sent over the wire, you are better off
+using the `setDebug` method in both the client and the server.
+
+=== Is there any limitation on the size of the requests / responses that can be successfully sent?
+
+Yes. But there is no hard figure to be given; it most likely will depend on the version of PHP in usage and its configuration.
+
+Keep in mind that this library is not optimized for speed nor for memory usage. Better alternatives exist when there are
+strict requirements on throughput or resource usage, such as the php native xmlrpc extension (see the PHP manual for
+more information).
+
+Keep in mind also that HTTP is probably not the best choice in such a situation, and XML is a deadly enemy. CSV formatted
+data over socket would be much more efficient. Or rpc protocols Googles' ProtoBuffer.
+
+If you really need to move a massive amount of data around, and you are crazy enough to do it using phpxmlrpc, your best
+bet is to bypass usage of the Value objects, at least in the decoding phase, and have the server (or client) object
+return to the calling function directly php values (see `Client::return_type` and `Server::functions_parameters_types`
+for more details, and the tips in the <<performances>> section).
+
+=== 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
+became later. As a consequence, no support was provided in the protocol for embedding XML elements from other namespaces
+into an xml-rpc 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 xml-rpc value, or as a base64 value. Since the '<' character in string values is encoded as '<' in
+the xml payload of the method call, the XML string will not break the surrounding xml-rpc, unless characters outside 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).
+
+=== My server (client) returns an error whenever the client (server) returns accented characters
+
+To be documented...
+
=== Can I use the MS Windows character set?
If the data your application is using comes from a Microsoft application, there are some chances that the character set
NB: unlike web browsers, not all xml-rpc clients support usage of http cookies. If you have troubles with sessions and
control only the server side of the communication, please check with the makers of the xml-rpc client in use.
+=== Does the library support following http redirects?
+
+Yes, but only when using cURL for transport.
+
+[source, php]
+----
+$client->setUseCurl(\PhpXmlRpc\Client::USE_CURL_ALWAYS);
+$client->setCurlOptions([CURLOPT_FOLLOWLOCATION => true, CURLOPT_POSTREDIR => 3]);
+----
+
+=== Does the library support setting custom cURL options?
+
+Yes. Set `+$client->use_curl = Client::USE_CURL_ALWAYS+` then use the Client method `+$client->setCurlOptions()+`
+
+=== How to enable long-lasting method calls
+
+To be documented...
+
=== Integration with the PHP xmlrpc extension
In short: for the fastest execution possible, you can enable the php native xmlrpc extension, and use it in conjunction