Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
RPCs, XML, Schemas, WSDL and SOAP
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] RPCs, XML, Schemas, WSDL and SOAP
On Fri, Jul 06, 2007 at 05:24:44PM +0100, Jon Harrop wrote:
> So I'm just looking into making remote procedure calls across the internet 
> using OCaml. It seems that the people who invented these protocols have made 
> a right pigs ear of it (again). :-)
> There have been several galiant attempts to get this working from OCaml. 
> OCSoap by Richard Jones looks good to me. However, it uses the pre 3.10 
> camlp4 extensively to analyze headers.
> Has anyone ported this to 3.10?

Also, OCSoap is only a client.  And WSDL is so complicated that
there's quite an effort required to adapt OCSoap to new schemas.

BTW, the camlp4 stuff in OCSoap isn't really required, and could be
removed with relative ease.

> Incidentally, I like the design but I would have written a
> dynamically typed bottom layer first myself. That way users could
> use the library to make calls without having to generate bindings
> first. Something like:
> # let rpc = Soap.connect url;;
> val rpc : string -> Soap.value list -> Soap.value = <fun>
> # Soap.to_float rpc("getTemp", [Soap.of_int 90210]);;
> - : float = 999.0
> Then the macro would spit out stubs that used that style.

Well, I guess the point of OCSoap was to write type-safe bindings to
the Google AdWords API.  The bindings are generated statically using a
CDuce program which grinds over the WSDL and generates *.ml and *.mli
files.  You then compile these and presto you have a type-safe client.


Have you looked into using SunRPC?  ocamlnet provides an
implementation, it can be run over SSL, it's far more lightweight than
XML, and there's a strong chance you'll be able to interoperate with
clients and servers written in other languages.  Another option would
be s-expressions using the Jane St. library.


Richard Jones
Red Hat