JS-XMLRPC

version 0.6.2

Gaetano Giunta

19 12 2012

Introduction

This collection of Javascript classes provides a framework for writing XML-RPC and JSON-RPC clients.

Main goals of the project are ease of use, flexibility and completeness. And of course, full API compatibility with the PHP-XMLRPC library.

XML-RPC is a format devised by Userland Software for achieving remote procedure call via XML using HTTP as the transport. XML-RPC has its own web site, www.xmlrpc.com.

JSON is a format devised to ease serialization and deserialization of common data types without incurring the overhead that is normally associated with XML. It is a subset of the Javascript language, and as such it is easily manipulated within web browsers.

JSON-RPC is a remote procedure call protocol that uses HTTP for transport and a json syntax extremely similar to the xml-rpc one.

Many thanks to the original author of the PHP-XMLRPC library: Edd Dumbill of Useful Information Company, to Jan-Klaas Kollhof for the Jsolait library and to the Yahoo! YUI team, for building such an incredible toolkit.

What's new

For all releases after 0.4, see the release info on GitHub at https://github.com/gggeek/jsxmlrpc/releases

version 0.4

version 0.3

version 0.2

version 0.1

Initial release of the library. Many "nice bits" are still missing (see Chapter 5 below), but the basic encoding/decoding functionality should be ok.

System requirements

Any browser or Javascript host with support for ECMAScript 6 including XMLHttpRequest and DOMParser. That should include NodeJS version v12.20.0 or v14.13.0 or later and Chrome 61, Edge 16, Firefox 60, Opera 48, Safari 11, Chrome Android 108, Firefox for Android 107, Opera Mobile 72, Safari on iOS 11, Samsung Internet 8.2.

Your mileage may vary on other browsers / javascript hosts.

Files in the distribution

Known bugs and limitations

Missing functionality that is part of the PHP-XMLRPC library include: handling of charset encoding (where explicitly requested by the user); timeout in send() methods for the sync calls; compression of requests; handling of compression, chunked encoding in parseResponseHeaders (the response body is decoded correctly by the browser); encoding/decoding of anonymous js classes via an xml attribute (since it is hard to recover a class name, we could encode instead all methods as code); allow username/password auth be specified in URL when creating a client object; using client credentials for https auth

Other: demo cases, reduce JSLint warnings, a testsuite and speed tests

Support

JS-XMLRPC is offered "as-is" without any warranty or commitment to support. However, informal advice and help is available via the JS-XMLRPC website.

Class documentation

Where's the meat?

Unfortunately, the documentation of the API exposed by the library has not (yet) really been integrated into the manual.

Luckily, it is available in HTML format online at: .... You can build it locally too if so inclined

For more details, the manual that comes with the php-xmlrpc library might prove helpful: after all the two libraries share the exact same API (except for a handful of small quirks due to differences in the underlying language, detailed in Apendix A). It is available online at https://gggeek.github.io/phpxmlrpc/doc-2/

Known differences from the PHP-XMLRPC API

Although the library is designed to implent the same programming interfaces of the php-xmlrpc library, differences in the languages (javascript vs. pgp) and underlying platform (browser vs. php engine) prevent a complete match. This list details the known differences in the behaviour of the two libraries. Please note that most of the discrepancies deal with private members of objects, unusual usage patterns and little known corner cases, and are mostly of interest to people that wish to extend / modify the library rather than just use it.