Options
All
  • Public
  • Public/Protected
  • All
Menu

XMLRPC

The XMLRPC object is a convenience method to provide an easy way to XML-RPC web services. The request function takes care of converting native Javascript objects and values to the XML parameters required for the XML-RPC interface, and converts the XML responses returned to Javascript objects.

It will also return faults parsed to error messages in the response if necessary.

This object is suitable for communication with a number of popular XML-RPC interfaces, including the MetaWeblog API. WordPress also offers it’s own XML-RPC interface, which can be used via this object, or the convenience wrapper WordPress object.

Example: XML-RPC call

// DEMO of XML-RPC
// Calls example method on http://xml-rpc.net/index.html

let url = "http://www.cookcomputing.com/xmlrpcsamples/RPC2.ashx";
let methodName = "examples.getStateName";
let params = [20];

let response = XMLRPC.request(url, methodName, params);

if (response.success) {
    alert(JSON.stringify(response.params));
}
else {
    alert("Fault: " + response.faultCode + ", " + response.error);
    context.fail();
}

Hierarchy

  • XMLRPC

Index

Methods

Methods

Static request

  • request(url: string, methodName: string, params: any[]): XMLRPCResponse
  • Make an XML-RPC request.

    Parameters

    • url: string

      The full URL of the XML-RPC host endpoint being called.

    • methodName: string

      Name of the method to call. Supported values are specific to the services provided by the host.

    • params: any[]

      The parameters to pass to the request. This should be an array of values, in the proper order, as specified by the documentation of the host being called. This array will be encoded into XML-RPC parameters in XML format by the method - only raw javascript values should be provided.

    Returns XMLRPCResponse

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc