UNMAINTAINED | This project is not maintained anymore (as of 2016 November 14).
This module only provides a string builder; it does not make any HTTP request by itself. Basically, it is just a small set of utils that create a valid "ready-to-be-sent" XMLRPC string, also meaning it works with any HTTP request module.
Installation for production
xmlrpc-message-umd is available on NPM
You can install it with the following command:
npm install xmlrpc-message-umd
Browser globals and AMD
xmlrpc-message-umd is available on Bower
To install it from Bower, just run
bower install xmlrpc-message-umd
Installation for development
You also can download the whole project (and build it from its source; see below).
git clone command to get it:
git clone https://github.com/t1st3/xmlrpc-message-umd.git
Or download the latest version of the whole project.
Then, get the dependencies of the project from both Bower and NPM:
npm install bower install
To create an XML-RPC message, just add parameters to a new instance of the lib, like the following:
var a = "chicken""duck""goose";var obj = ;objx = 20;objy = "cow";objz = 314;var date = ;var msg = ;msg;msg;msg;msg;msg;msg;msg;msg;
msg.xml() would then return the complete XML string.
By default, the type of the parameters is automatically detected. You can prevent this behavior and force the type of a parameter, for example:
var msg = ;msg;msg;
As described on Apache Sofftware Foundation's XMLRPC documentation, the following types are available for XMLRPC:
Finally, you can also force types of elements within a
struct element or an
var obj = ;objx = 20;objy = data: "cow" type: "base64";var msg = ;msg;msg;
Build from source
First, see "Installation for development" above. Do not forget to get the dependencies!
Then, you also need to install Gulp globally to build the project.
npm install -g gulp
See more at the "Getting started with Gulp" page.
Once you got the dependencies and installed Gulp globally, to get info about the package from the command line, just run:
You are now ready to build!
The source is located in the "src" folder; the built target is located in the "dist" folder.
To build, just run:
To test, you can use either the
npm test command or the
gulp test command:
Serve and livereload
You can also use the
serve task to load the html pages from
./test/ in your browser.
Once it has loaded the page in the browser, this task watches for any modification in the source. If changes happen in the source, the task automatically reloads the page in the browser (livereload).
This piece of code is triple-licensed: MIT / BSD / GPL licenses