| Title: | Implementation of the Remote Procedure Call Protocol ('XML-RPC') |
|---|---|
| Description: | The 'XML-RPC' is a remote procedure call protocol based on 'XML'. The 'xmlrpc2' package is inspired by the 'XMLRPC' package but uses the 'curl' and 'xml2' packages instead 'RCurl' and 'XML'. |
| Authors: | Florian Schwendinger [aut, cre] |
| Maintainer: | Florian Schwendinger <[email protected]> |
| License: | GPL-3 |
| Version: | 1.2 |
| Built: | 2026-05-29 11:25:28 UTC |
| Source: | https://github.com/florianschwendinger/xmlrpc2 |
XML-RPC Format into an R Object.Convert an object of class "xml_code" or
a character in the XML-RPC Format into an R Object.
from_xmlrpc(xml, raise_error = TRUE)from_xmlrpc(xml, raise_error = TRUE)
xml |
a character string containing |
raise_error |
a logical controling the behavior if the
|
an R object derived from the input.
params <- list(1L, 1:3, rnorm(3), LETTERS[1:3], charToRaw("A")) xml <- to_xmlrpc("some_method", params) from_xmlrpc(xml)params <- list(1L, 1:3, rnorm(3), LETTERS[1:3], charToRaw("A")) xml <- to_xmlrpc("some_method", params) from_xmlrpc(xml)
XML-RPC FormatSerialize R Objects so they can be passed to
to_xmlrpc as parameters.
rpc_serialize(x, ...)rpc_serialize(x, ...)
x |
an R object. |
... |
additional optional arguments (currently ignored). |
an object of class "xml_node".
rpc_serialize(1L) rpc_serialize(1:2) rpc_serialize(LETTERS[1:2])rpc_serialize(1L) rpc_serialize(1:2) rpc_serialize(LETTERS[1:2])
XML-RPC CallConstructs the XML body for an XML-RPC request. This function takes the target method name and a list of R objects as parameters. Each parameter in the list is converted into its corresponding XML-RPC representation using the 'rpc_serialize' method. The resulting XML structure follows the XML-RPC specification for a method call, encapsulating the method name and the serialized parameters. This function is typically used internally by the main 'xmlrpc' function to prepare the request before sending it to the server, but it can also be used directly to inspect the XML that would be generated.
to_xmlrpc(method, params)to_xmlrpc(method, params)
method |
a character string giving the name of the method to be invoked. |
params |
a list containing the parmeters which are added to
the |
an object of class "xml_node" containing a XML-RPC call.
params <- list(1L, 1:3, rnorm(3), LETTERS[1:3], charToRaw("A")) cat(as.character(to_xmlrpc("some_method", params)))params <- list(1L, 1:3, rnorm(3), LETTERS[1:3], charToRaw("A")) cat(as.character(to_xmlrpc("some_method", params)))
Call a reomte procedure with the XML-RPC protocol.
xmlrpc( url, method, params = list(), handle = NULL, opts = list(), convert = TRUE, useragent = "xmlrpc", raise_error = TRUE )xmlrpc( url, method, params = list(), handle = NULL, opts = list(), convert = TRUE, useragent = "xmlrpc", raise_error = TRUE )
url |
a character string giving the url to the server. |
method |
a character string giving the name of the method to be invoked. |
params |
a list containing the parmeters which are added to
the |
handle |
a object of class |
opts |
a list of options passed to the function |
convert |
a logical, if convert is |
useragent |
a character string giving the name of the |
raise_error |
a logical controling the behavior if the status code
of |
the reponse of curl or the response converted to
R objects.
## Not run: url <- "https://www.neos-server.org" xmlrpc(url, "listAllSolvers") xmlrpc(url, "listSolversInCategory", params = list(category = "socp")) ## End(Not run)## Not run: url <- "https://www.neos-server.org" xmlrpc(url, "listAllSolvers") xmlrpc(url, "listSolversInCategory", params = list(category = "socp")) ## End(Not run)