Skip to content
Fuchs-David edited this page Jan 17, 2019 · 14 revisions

Libxmlrpc

Libxmlrpc is an open source module designed to provide XML-RPC server functionality to applications written in the Prolog language.

Using libxmlrpc

To use this module in your application, you need to follow these steps:

  1. Put the predicates that you want to expose through XML-RPC into a module.
  2. You need to export at least one predicate which takes 2 arguments - first is for your output while the second one is input.
  3. Register your module by calling predicate register with your module's name as an argument like in this example: register(NameOfYourModule).

Description of module API

This section should show you everything you need to know about what this module expects from your application and what you can expect from this module.

Input

Input (from the application's perspective) is composed of a flat list.

Future versions of this module may introduce support for multi-layer lists and compounds (structs in XML-RPC).

Output

Output (from the application's perspective) is composed of either a flat list, which may contain any atomic type, or a compound describing a fault in the following manner: fault(faultCode(YourFaultCode),faultString(YourFaultString))

It is recommended to only use the following codes directly from within your application:

  • -32602 ---> server error. invalid method parameters
  • -32500 ---> application error
  • -32099 .. -32000 ---> any error message

Clone this wiki locally