-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Libxmlrpc is an open source module designed to provide XML-RPC server functionality to applications written in the Prolog language.
To use this module in your application, you need to follow these steps:
- Put the predicates that you want to expose through XML-RPC into a module.
- You need to export at least one predicate which takes 2 arguments - first is for your output while the second one is input.
- Register your module by calling predicate
register
with your module's name as an argument like in this example:register('NameOfYourModule')
.
After registering your module you have several options to start the server:
- Use the
server/0
predicate to start server listening on the default port of 8080. - Use the
server/1
predicate to specify the port you want. - Use the
server/1
predicate to specify the SSL information (certificate file location, key file location, password) in the following way:ssl(["certificate-file","key-file","password"])
. - Use the
server/2
predicate to specify the port and the SSL information from the previous point.
It is highly recommended to use the HTTPS version for servers accessible from the internet.
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 (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 (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
Support of more standard faults from http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php may appear in the future.