{"id":12692,"library":"xmlrpc","title":"XML-RPC Client and Server","description":"The `xmlrpc` package provides a pure JavaScript implementation of an XML-RPC client and server for Node.js environments. Its core differentiator is the exclusive use of JavaScript libraries for XML parsing (via `sax-js`) and XML building (via `xmlbuilder`), thereby avoiding native C dependencies and their associated build requirements. This allows developers to set up XML-RPC communication without needing a C compiler or specific system libraries. The package supports both client and server roles, enabling applications to make and receive XML-RPC method calls. Key features include configurable ISO 8601 date/time formatting for both encoding and decoding, and optional support for HTTP cookies to maintain session state. The latest stable version is 1.3.2, released in June 2016. Due to its age, it exhibits an effectively abandoned release cadence, with no updates in nearly a decade.","status":"abandoned","version":"1.3.2","language":"javascript","source_language":"en","source_url":"git://github.com/baalexander/node-xmlrpc","tags":["javascript","xml-rpc","xmlrpc","xml","rpc"],"install":[{"cmd":"npm install xmlrpc","lang":"bash","label":"npm"},{"cmd":"yarn add xmlrpc","lang":"bash","label":"yarn"},{"cmd":"pnpm add xmlrpc","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used internally for XML parsing.","package":"sax","optional":false},{"reason":"Used internally for XML document construction.","package":"xmlbuilder","optional":false}],"imports":[{"note":"This package is CommonJS-only. Direct ES module `import` syntax will fail.","wrong":"import xmlrpc from 'xmlrpc'","symbol":"xmlrpc","correct":"const xmlrpc = require('xmlrpc')"},{"note":"Accessed as a method of the default `xmlrpc` export; not a named export.","wrong":"import { createServer } from 'xmlrpc'","symbol":"createServer","correct":"const server = xmlrpc.createServer({ host: 'localhost', port: 9090 })"},{"note":"Accessed as a method of the default `xmlrpc` export; not a named export.","wrong":"import { createClient } from 'xmlrpc'","symbol":"createClient","correct":"const client = xmlrpc.createClient({ host: 'localhost', port: 9090, path: '/' })"}],"quickstart":{"code":"const xmlrpc = require('xmlrpc');\n\n// Creates an XML-RPC server to listen to XML-RPC method calls\nconst server = xmlrpc.createServer({ host: 'localhost', port: 9090 });\n\n// Handle methods not found\nserver.on('NotFound', function(method, params) {\n  console.log('Method ' + method + ' does not exist');\n});\n\n// Handle method calls by listening for events with the method call name\nserver.on('anAction', function (err, params, callback) {\n  console.log('Method call params for \\'anAction\\': ' + params);\n\n  // ...perform an action...\n\n  // Send a method response with a value\n  callback(null, 'aResult');\n});\nconsole.log('XML-RPC server listening on port 9090');\n\n// Waits briefly to give the XML-RPC server time to start up and start\n// listening\nsetTimeout(function () {\n  // Creates an XML-RPC client. Passes the host information on where to\n  // make the XML-RPC calls.\n  const client = xmlrpc.createClient({ host: 'localhost', port: 9090, path: '/'});\n\n  // Sends a method call to the XML-RPC server\n  client.methodCall('anAction', ['aParam'], function (error, value) {\n    // Results of the method response\n    console.log('Method response for \\'anAction\\': ' + value);\n  });\n\n}, 1000);","lang":"javascript","description":"This example demonstrates how to set up both an XML-RPC server and client, allowing them to communicate locally. It registers a server method 'anAction' and then uses the client to invoke it, showcasing basic call and response patterns."},"warnings":[{"fix":"Evaluate actively maintained alternatives for XML-RPC communication or thoroughly audit the code and its dependencies for security and compatibility issues if you must use this package. Consider using a compatibility layer for CommonJS in ESM projects.","message":"The `xmlrpc` package has not been updated since June 2016 (v1.3.2). This signifies a lack of active maintenance, posing compatibility risks with modern Node.js versions (e.g., ESM, current HTTP standards), potential unpatched security vulnerabilities in its own code or its `sax` and `xmlbuilder` dependencies, and general instability when integrated into contemporary applications.","severity":"gotcha","affected_versions":">=1.3.2"},{"fix":"Upgrade your Node.js runtime to a more recent, supported version (e.g., Node.js v6.x or newer as supported by the last release).","message":"Support for Node.js v0.8 was explicitly dropped in version 1.3.2. Applications running on very old Node.js environments may encounter issues or require a downgrade to an earlier `xmlrpc` version.","severity":"breaking","affected_versions":">=1.3.2"},{"fix":"Always use `const xmlrpc = require('xmlrpc');` for importing the module. If working in an ESM-only project, you might need to use a bundler or a wrapper to consume CommonJS modules.","message":"This package is a CommonJS module and does not natively support ES module `import` syntax. Attempting to use `import xmlrpc from 'xmlrpc'` in a pure ESM context will result in a runtime error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Thoroughly test XML payloads and parsing logic when upgrading `xmlrpc` across major minor versions to ensure consistent behavior, especially if you rely on specific XML structuring or attribute ordering.","message":"The underlying XML builder library (`xmlbuilder`) saw significant version updates across `xmlrpc` releases (e.g., v2.4 to v8.2). While `xmlrpc` aims to abstract this, large jumps in internal dependency versions can sometimes introduce subtle changes in XML output or parsing behavior, particularly with edge cases.","severity":"gotcha","affected_versions":">=1.3.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Change your import statement to `const xmlrpc = require('xmlrpc');`.","cause":"Attempting to use ES module `import` syntax to load the CommonJS-only `xmlrpc` package.","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Ensure that `server.on('methodName', function(err, params, callback){...})` is defined for every method the server is expected to handle. Implement a `server.on('NotFound', ...)` handler for debugging unhandled method calls.","cause":"The XML-RPC server received a method call for which no corresponding event listener was registered using `server.on('methodName', ...)`.","error":"Method 'yourMethodName' does not exist"},{"fix":"Use `xmlrpc.dateFormatter.setOpts(options)` to precisely configure the date encoding options (e.g., `colons`, `hyphens`, `local`, `ms`, `offset`) to match the requirements of your XML-RPC communication partners.","cause":"The default ISO 8601 date formatting used by `xmlrpc` for encoding does not match the specific variant expected by the receiving XML-RPC endpoint, or vice-versa.","error":"Date/Time format mismatch or parsing errors in XML-RPC communication."}],"ecosystem":"npm"}