Xenium v0.1.0 Xenium View Source

An XML-RPC client for Elixir.

Xenium simply combines the functionality of the HTTPoison and XML-RPC libraries so you can get stuff done.

Link to this section Summary

Functions

Post the XML-RPC server URL with a method name and optional parameters

Post the XML-RPC server URL with a method name and optional parameters, raising an exception on failure

Link to this section Functions

Link to this function call(url, method_name, params \\ []) View Source
call(binary(), binary(), list()) :: {:ok, any()} | {:error, any()}

Post the XML-RPC server URL with a method name and optional parameters.

Returns a tuple of { :ok, response } or { :error, message }, where the error tuple contains either the error response from HTTPoison or the XML-RPC library.

Examples

Xenium.call "http://localhost:11311", "getSystemState", ["/"]
#=> { :ok, [1, "current state", ... ] }
Xenium.call "http://lclhst:11311", "getSystemState", ["/"]
#=> { :error, %HTTPoison.Error{id: nil, reason: :nxdomain} }
Xenium.call "http://localhost:11311", "unsupportedMethod", ["/"]
#=> { :error, %XMLRPC.Fault{fault_code: 1,
#     fault_string: "<type 'exceptions.Exce..."} }
Link to this function call!(url, method_name, params \\ []) View Source
call!(binary(), binary(), list()) :: any()

Post the XML-RPC server URL with a method name and optional parameters, raising an exception on failure.

The functions used in the pipeline are encode! post! and decode!, which all raise exceptions on failure.

Examples

Xenium.call! "http://localhost:11311", "getSystemState", ["/"]
#=> [1, "current state", ... ]