Type: | Package |
Title: | Implementation of the Remote Procedure Call Protocol ('XML-RPC') |
Version: | 1.2 |
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'. |
License: | GPL-3 |
Imports: | curl, xml2, base64enc |
Encoding: | UTF-8 |
NeedsCompilation: | no |
Packaged: | 2025-05-02 19:37:09 UTC; f |
Author: | Florian Schwendinger [aut, cre] |
Maintainer: | Florian Schwendinger <FlorianSchwendinger@gmx.at> |
Repository: | CRAN |
Date/Publication: | 2025-05-02 20:10:02 UTC |
Convert from the XML-RPC
Format into an R Object.
Description
Convert an object of class "xml_code"
or
a character in the XML-RPC
Format into an R Object.
Usage
from_xmlrpc(xml, raise_error = TRUE)
Arguments
xml |
a character string containing |
raise_error |
a logical controling the behavior if the
|
Value
an R object derived from the input.
Examples
params <- list(1L, 1:3, rnorm(3), LETTERS[1:3], charToRaw("A"))
xml <- to_xmlrpc("some_method", params)
from_xmlrpc(xml)
Convert R Objects into the XML-RPC
Format
Description
Serialize R Objects so they can be passed to
to_xmlrpc
as parameters.
Usage
rpc_serialize(x, ...)
Arguments
x |
an R object. |
... |
additional optional arguments (currently ignored). |
Value
an object of class "xml_node"
.
Examples
rpc_serialize(1L)
rpc_serialize(1:2)
rpc_serialize(LETTERS[1:2])
Create a XML-RPC
Call
Description
Constructs 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.
Usage
to_xmlrpc(method, params)
Arguments
method |
a character string giving the name of the method to be invoked. |
params |
a list containing the parmeters which are added to
the |
Value
an object of class "xml_node"
containing a XML-RPC
call.
Examples
params <- list(1L, 1:3, rnorm(3), LETTERS[1:3], charToRaw("A"))
cat(as.character(to_xmlrpc("some_method", params)))
Call the Remote Procedure
Description
Call a reomte procedure with the XML-RPC
protocol.
Usage
xmlrpc(
url,
method,
params = list(),
handle = NULL,
opts = list(),
convert = TRUE,
useragent = "xmlrpc",
raise_error = TRUE
)
Arguments
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 |
Value
the reponse of curl
or the response converted to
R objects.
Examples
## Not run:
url <- "https://www.neos-server.org"
xmlrpc(url, "listAllSolvers")
xmlrpc(url, "listSolversInCategory", params = list(category = "socp"))
## End(Not run)