caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* RPCs, XML, Schemas, WSDL and SOAP
@ 2007-07-06 16:24 Jon Harrop
  2007-07-06 18:57 ` [Caml-list] " Richard Jones
  2007-07-07 13:51 ` Oliver Bandel
  0 siblings, 2 replies; 7+ messages in thread
From: Jon Harrop @ 2007-07-06 16:24 UTC (permalink / raw)
  To: caml-list


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?

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.

Also, what's the state of XML reading and writing in OCaml. I've been using 
xml-light, which is excellent albeit "light", but I notice there is pxp and 
expat. Is expat just a parser, so it can't generate XML?

PS: Sorry if this gets double posted: I think the original got spam filtered 
at INRIA.
-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
The OCaml Journal
http://www.ffconsultancy.com/products/ocaml_journal/?e


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] RPCs, XML, Schemas, WSDL and SOAP
  2007-07-06 16:24 RPCs, XML, Schemas, WSDL and SOAP Jon Harrop
@ 2007-07-06 18:57 ` Richard Jones
  2007-07-07 12:51   ` Benedikt Grundmann
  2007-07-09 11:10   ` Gerd Stolpmann
  2007-07-07 13:51 ` Oliver Bandel
  1 sibling, 2 replies; 7+ messages in thread
From: Richard Jones @ 2007-07-06 18:57 UTC (permalink / raw)
  To: Jon Harrop; +Cc: caml-list

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.

Rich.

-- 
Richard Jones
Red Hat


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] RPCs, XML, Schemas, WSDL and SOAP
  2007-07-06 18:57 ` [Caml-list] " Richard Jones
@ 2007-07-07 12:51   ` Benedikt Grundmann
  2007-07-09 11:10   ` Gerd Stolpmann
  1 sibling, 0 replies; 7+ messages in thread
From: Benedikt Grundmann @ 2007-07-07 12:51 UTC (permalink / raw)
  To: Richard Jones; +Cc: Jon Harrop, caml-list

I haven't followed this discussion, but assuming that you only want to
do remote procedure calls between programs written in ocaml, you will
soon be able to use my eConcurrency library.  I'm writing this library
as part of the OCaml Summer Project, it (will) provide means to write
concurrent and distributed programs in style similar to erlang.
Concurrency is based on separate processes communicating over unix
domain sockets (that part is done), distribution will be based tcp/ip
and a first version should be done by the end of this weekend/middle
of next week.

Cheers,

Bene


2007/7/6, Richard Jones <rich@annexia.org>:
> 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.
>
> Rich.
>
> --
> Richard Jones
> Red Hat
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


-- 
Calvin: I try to make everyone's day a little more
surreal.

(From Calvin & Hobbes)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] RPCs, XML, Schemas, WSDL and SOAP
  2007-07-06 16:24 RPCs, XML, Schemas, WSDL and SOAP Jon Harrop
  2007-07-06 18:57 ` [Caml-list] " Richard Jones
@ 2007-07-07 13:51 ` Oliver Bandel
  2007-07-07 13:57   ` Jon Harrop
  1 sibling, 1 reply; 7+ messages in thread
From: Oliver Bandel @ 2007-07-07 13:51 UTC (permalink / raw)
  To: caml-list

Hello Jon,


Zitat von Jon Harrop <jon@ffconsultancy.com>:

>
> 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). :-)


What does it mean, to make a right pigs ear?


OCaml-XML-RPC:
   http://raevnos.pennmush.org/code/ocaml-xml-rpc/


[...]
> Also, what's the state of XML reading and writing in OCaml. I've been using
> xml-light, which is excellent albeit "light", but I notice there is pxp and
> expat. Is expat just a parser, so it can't generate XML?

I just looked at XMKL-light some days ago.
The other tools you mentioned, I don't know about.


BTW: today the INRIA-server is available again.

There is an overview / Link-page to XML-stuff for OCaml:

  http://caml.inria.fr/pub/old_caml_site/humps/caml_XML_tools.html


Ciao,
   Oliver


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] RPCs, XML, Schemas, WSDL and SOAP
  2007-07-07 13:51 ` Oliver Bandel
@ 2007-07-07 13:57   ` Jon Harrop
  0 siblings, 0 replies; 7+ messages in thread
From: Jon Harrop @ 2007-07-07 13:57 UTC (permalink / raw)
  To: caml-list

On Saturday 07 July 2007 14:51:34 Oliver Bandel wrote:
> Hello Jon,
>
> Zitat von Jon Harrop <jon@ffconsultancy.com>:
> > 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). :-)
>
> What does it mean, to make a right pigs ear?

It means they did a very bad job. Richard Jones cited some fun articles 
describing the problems, at the bottom of this page:

  http://merjis.com/developers/oc-soap

If I had the choice I would certainly choose something more robust like 
XML-RPC but, for some unknown reason, the world seems to have ditched all of 
the preferable options in favour of the insane ones. Just another case of 
industry taking a simple problem and making it incredibly complicated for no 
reason. Anyway, I'm going to watch a betamax video whilst listening to some 
OGG music. ;-)

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
The OCaml Journal
http://www.ffconsultancy.com/products/ocaml_journal/?e


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] RPCs, XML, Schemas, WSDL and SOAP
  2007-07-06 18:57 ` [Caml-list] " Richard Jones
  2007-07-07 12:51   ` Benedikt Grundmann
@ 2007-07-09 11:10   ` Gerd Stolpmann
  2007-07-09 11:47     ` Richard Jones
  1 sibling, 1 reply; 7+ messages in thread
From: Gerd Stolpmann @ 2007-07-09 11:10 UTC (permalink / raw)
  To: Richard Jones; +Cc: Jon Harrop, caml-list

Am Freitag, den 06.07.2007, 19:57 +0100 schrieb Richard Jones:
> 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.  

It is not only a chance, it simply works. But be warned: My SunRPC
implementation is a very strong one, far better than what can be found
in libc. Unfortunately, many developers have prejudices against this
simple and robust protocol because of the weak (because old) C
implementation.

> Another option would
> be s-expressions using the Jane St. library.

And another one is JSON over HTTP. This especially interesting for web
apps because you can easily access the data from javascript.

Gerd
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] RPCs, XML, Schemas, WSDL and SOAP
  2007-07-09 11:10   ` Gerd Stolpmann
@ 2007-07-09 11:47     ` Richard Jones
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Jones @ 2007-07-09 11:47 UTC (permalink / raw)
  To: Jon Harrop; +Cc: caml-list

On Mon, Jul 09, 2007 at 01:10:48PM +0200, Gerd Stolpmann wrote:
> Am Freitag, den 06.07.2007, 19:57 +0100 schrieb Richard Jones:
> > 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.  
> 
> It is not only a chance, it simply works. But be warned: My SunRPC
> implementation is a very strong one, far better than what can be found
> in libc. Unfortunately, many developers have prejudices against this
> simple and robust protocol because of the weak (because old) C
> implementation.

Heh heh, tell me about it :-)

XDR is a simple, lightweight, statically-typed protocol.  SunRPC is a
simple RPC protocol built on XDR.  Unfortunately the glibc
implementation of SunRPC sucks greatly.  It is also essentially
unmaintained.  However there are alternatives (in C); for example
TI-RPC.

One "myth" of SunRPC is that it requires portmappers and UDP, which
are slow, a pain to use, make tunnelling more difficult, and have
well-known security vulnerabilities.  In fact it is easy to run SunRPC
over fixed TCP ports.

If you are considering interoperating with C or Python, or want to use
IPv6 or SSL, you might consider reading some pages I wrote on the
subject:

http://et.redhat.com/~rjones/secure_rpc/
http://et.redhat.com/~rjones/sunrpc_reconnection/
http://et.redhat.com/~rjones/xdr_tests/

and also see if you can pick up a second hand copy of this O'Reilly
book:

http://www.oreilly.com/catalog/rpc/

Rich.

-- 
Richard Jones
Red Hat


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-07-09 11:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-06 16:24 RPCs, XML, Schemas, WSDL and SOAP Jon Harrop
2007-07-06 18:57 ` [Caml-list] " Richard Jones
2007-07-07 12:51   ` Benedikt Grundmann
2007-07-09 11:10   ` Gerd Stolpmann
2007-07-09 11:47     ` Richard Jones
2007-07-07 13:51 ` Oliver Bandel
2007-07-07 13:57   ` Jon Harrop

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).