[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Dave Benjamin <dave@r...> |
| Subject: | ANN: XmlRpc-Light 0.4 - Now a server too |
I have released XmlRpc-Light 0.4, an XML-RPC library for OCaml based on
Xml-Light and Ocamlnet 2. Source, downloads, and documentation are
available here:
http://code.google.com/p/xmlrpc-light/
This version adds support for writing servers. Two methods are currently
provided: CGI (based on Netcgi2) and Netplex. The obligatory hello-world
example looks like this:
let server = new XmlRpcServer.cgi () in
server#register "demo.sayHello"
(fun _ -> `String "Hello!");
server#run ()
To build a Netplex server, just change "cgi" to "netplex". An example of
a Netplex server including the required configuration file is in the
examples/adder directory.
All servers support the "system.getCapabilities" and
"system.listMethods" introspection functions, as well as the
"system.multicall" protocol. These can be disabled if desired by calling
the "unregister" method.
Other changes and improvements:
- The default date-time functions use the format
"20070729T10:42:00-07:00". This seems to be the most common
interpretation of ISO 8601 used in XML-RPC servers. You can override
this behavior by calling the "set_datetime_encode" or
"set_datetime_decode" methods on the client or server.
- Date-time parsing errors are now wrapped in XmlRpc.Error so that
they will be relayed to clients as faults.
- Error handling adheres much closer to the XML-RPC specification and
its list of suggested fault codes and strings.
- The client now sends a "text/xml" Content-Type header in requests.
Thanks to Gerd Stolpmann for the help with Ocamlnet!
Dave