From: Dave Benjamin <dave@ramenlabs.com>
To: caml-list@yquem.inria.fr
Subject: ANN: XmlRpc-Light 0.5
Date: Sat, 15 Sep 2007 14:55:55 -0700 [thread overview]
Message-ID: <46EC54EB.8010909@ramenlabs.com> (raw)
I'm happy to announce the release of version 0.5 of XmlRpc-Light.
XmlRpc-Light is an XmlRpc library written in OCaml. It requires
Xml-Light and Ocamlnet 2.
http://code.google.com/p/xmlrpc-light/
New in version 0.5
* client: configurable socket timeouts
* client: basic authentication
* client: custom HTTP headers
* client: SSL support (requires command-line "curl" program)
* client: multicall class with optional lazy call behavior
* client: better interoperability with Apache XMLRPC
* client: code generation tool based on introspection functions
* server: methodHelp and methodSignature introspection functions
* server: shallow type checking of method signatures
* server: multiple signatures per method (overloading)
* both: proper text/xml Content-Type header and xml preamble
* both: 32-bit integer support
This version features a convenience class for "multicall", a de-facto
standard protocol for packaging multiple method calls together into a
single request. It uses OCaml's lazy type to keep the interface very
similar to regular method calls. Use of the lazy behavior is optional.
Instances take an XmlRpc.client as an argument:
# let mc = new XmlRpc.multicall client;;
val mc : XmlRpc.multicall = <obj>
The "call" method works like client#call, but it returns a lazy value:
# let a = mc#call "demo.addTwoNumbers" [`Int 3; `Int 4];;
val a : XmlRpc.value Lazy.t = <lazy>
# let b = mc#call "demo.addTwoNumbers" [`Int 42; `String "oh
noes!"];;
val b : XmlRpc.value Lazy.t = <lazy>
# let c = mc#call "demo.addTwoNumbers" [`Double 3.0; `Double 4.0];;
val c : XmlRpc.value Lazy.t = <lazy>
At this point, the call has not been executed yet:
# mc#executed;;
- : bool = false
As soon as one of the return values is forced, the call is executed:
# Lazy.force a;;
-- : XmlRpc.value = `Int 7
# mc#executed;;
- : bool = true
Once a call has been executed, this instance cannot be used to make any
further calls; instead, a new multicall instance must be created:
# mc#call "demo.addTwoNumbers" [`Int 2; `Int 2];;
Exception: Failure "multicall#call: already executed".
If an XmlRpc fault occurred, the exception will be thrown when the lazy
value is forced: # Lazy.force b;; Exception: XmlRpc.Error (-32602,
"server error. invalid method parameters"). ]} This will not prevent
further methods from executing successfully:
# Lazy.force c;;
- : XmlRpc.value = `Double 7.
It is possible for a multicall to be executed but not completed, for
example if a transport occurs. Aside from catching the exception, the
completed property indicates if the call actually went through or not:
# mc#completed;;
- : bool = true
It is not necessary to use lazy values. Instead, the call can be
executed explicitly, and the results can be retrieved by number:
# let mc = new XmlRpc.multicall client;;
val mc : XmlRpc.multicall = <obj>
# ignore (mc#call "demo.addTwoNumbers" [`Int 2; `Int 2]);;
-- : unit = ()
# ignore (mc#call "demo.addTwoNumbers" [`Int 3; `Int 3]);;
-- : unit = ()
# mc#result 1;;
-- : XmlRpc.value = `Int 6
This release also includes a fix to the WordPress example code, thanks
to Janne Hellsten. It has been tested with Ocamlnet 2.2.7 and 2.2.8,
though the use of 2.2.8 or newer is recommended for correct behavior of
the Netplex server.
Best wishes,
Dave
reply other threads:[~2007-09-15 21:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46EC54EB.8010909@ramenlabs.com \
--to=dave@ramenlabs.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox