David MENTRE | 31 Aug 2006 13:48
Favicon

On web client, XML and ONC RPC and their integration with demexp

Hello,

To put this message into context, Augustin has recently proposed[1] to
make a web interface for demexp using Drupal. One of the main issue of
this proposal and that there is no implementation of ONC RPC (used to
communicate with demexp server) in PHP (and hence for Drupal). However,
Drupal has a XML RPC module[2].

I started to look at this issue[3] and found no easy way to solve
it. 

One approach would be to compile the XDR description of demexp protocol
into C using rpcgen(3) and then make a PHP binding to it. While
apparently not too difficult, this approach is not very versatile: if
the protocol is modified, one needs to modify manually the PHP/C
binding.

A second approach would be to implement an RPC generator and its
supporting XDR encoding/decoding library for PHP. I haven't much
investigated this approach but it seems to me not a very simple
path. Moreover, beside demexp, I don't think a lot of people in the PHP
community are eager to use ONC RPC. :-)

A third approach would be to implement the XML RPC interface on the
demexp side. This seems doable with current infrastructure. Gerd's has
confirmed me that we could have simultaneously XML and ONC RPC inside
demexp[4] and, it should be possible to use CDuce to implement XML
parsing and generation[5]. However, I'm not entirely satisfied with this
approach: it would necessitate to have two interfaces at the demexp
server, XML RPC and ONC RPC, thus two interfaces to debug, test and
(Continue reading)

Thomas Petazzoni | 8 Sep 2006 23:58
Gravatar

Re: On web client, XML and ONC RPC and their integration with demexp

Hi,

Le Thu, 31 Aug 2006 13:48:07 +0200,
David MENTRE <dmentre <at> linux-france.org> a écrit :

> This leads me to a fourth approach: implement a XML RPC <-> ONC RPC
> proxy as an interface between the XML RPC side (Drupal) and the ONC
> RPC side (demexp server). It would act as a server on the XML RPC
> side and as a client on the ONC RPC side. This approach seems to me
> nicer because there is no need for a re-implementation of all server
> network API: the same ONC RPC interface is used for both the web and
> native clients on the server side. Moreover, such a proxy would be an
> independant software, with well defined interfaces, so easier to
> maintain, understand and modify.

At first, I thought that this approach was overkill, but after thinking
a bit about it, I think like David that it's the best option. It allows
to not bloatify the code of the demexp server itself by not supporting
two RPCs types, and it's better since we don't know if XML RPC will be
kept on the long term.

However, I suggest to be careful about the complexity of the demexp
software. It's starting to be:
 - a server in OCaml with lots of dependencies, making it hard to
   compile when you're not using a good distribution (Debian)
 - a proxy in Python that uses unpackaged library (pyrpc)
 - a web client in PHP/Drupal which runs over Apache.

For the newcomer, it's probably going to be harder and harder to get
involved in the projet if so many languages, library and compilers are
(Continue reading)

David MENTRE | 9 Sep 2006 12:01
Favicon

Re: On web client, XML and ONC RPC and their integration with demexp

Hello Thomas,

Thomas Petazzoni <thomas.petazzoni <at> enix.org> writes:

> However, I suggest to be careful about the complexity of the demexp
> software. It's starting to be:
>  - a server in OCaml with lots of dependencies, making it hard to
>    compile when you're not using a good distribution (Debian)
>  - a proxy in Python that uses unpackaged library (pyrpc)
>  - a web client in PHP/Drupal which runs over Apache.

I share your concerns:

 1. I have chosen current path as to be as efficient as possible and
    reuse existing code, even if it adds a lot of dependencies;

 2. Most of new dependencies are for the server side, that is not needed
    to replicate on the client side;

 3. I hope in the long term we'll find way to remove dependencies or at
    least make them more coherent[1].

I'm open to any suggestion.

> For the newcomer, it's probably going to be harder and harder to get
> involved in the projet if so many languages, library and compilers are
> used, and if the architecture becomes more complex.

On the other side, as Augustin said, it offers more opportunity for
somebody to contribute. 
(Continue reading)

Augustin | 9 Sep 2006 05:50

about Complexity and technical choices and about personal motivation.

Bonjour Thomas,

On Saturday 09 September 2006 05:58 am, Thomas Petazzoni wrote:
> At first, I thought that this approach was overkill, but after thinking
> a bit about it, I think like David that it's the best option. It allows
> to not bloatify the code of the demexp server itself by not supporting
> two RPCs types, and 

> it's better since we don't know if XML RPC will be 
> kept on the long term.

I certainly do hope it will be kept. If it is not, it means that all the time 
I am spending coding the client would be wasted. And the same can be said of 
David's time spent on the proxy itself.

As I have abundantly made clear 1-2 weeks ago, I am not coding for pleasure, 
but I am coding to see concrete results (I'm sure David will concur). 

I have given up another project so that I can invest more time into this one, 
because I felt that my input into this project could have quicker results on 
the society. 

I care about democracy, about voting systems (which you are probably aware of, 
if you've read my introductionnary material) and I am concerned about the 
direction our world in going towards.

That's why I felt uneasy when you didn't directly answer the question I asked 
you two weeks ago about the python/php choice.
I hope the python web client is currently no longer an option. 

(Continue reading)

Augustin | 1 Sep 2006 06:44

ONC RPC for PHP? Re: On web client, XML and ONC RPC and their integration with demexp

David and all,

In my previous email, I stated that re-coding the server to use XML RPC only 
could be the easiest and the best solution in the long term.
It certainly would make things easier for me, if not for you ;).

Honestly, my main concern is NOT to save myself some troubles, but to make the 
right technical choice that we will not regret later (because it is easy to 
maintain, because it is easy to install and to use and thereby attracting 
more developers, etc).

For the sake of argument, what if leaving the server as is (using ONC RPC) and 
creating a library coded in PHP (I cannot help with anything else) IS the 
best technical and tactical choice?

In this mail, then, I try to figure out what it would take.
As you read the following, the extent of my ignorance should become obvious. 
It is important that you know of my limitations so that you know what kind of 
help to expect from me :)
Please be patient with me, and tell me where I am wrong.

On Thursday 31 August 2006 07:48 pm, David MENTRE wrote:
> A second approach would be to implement an RPC generator and its
> supporting XDR encoding/decoding library for PHP. 

Do you mean "for" PHP (as in creating a PHP module coded in C) on "in" PHP (as 
in coding a library in PHP that I could integrate into my Drupal module)?

> I haven't much 
> investigated this approach but it seems to me not a very simple
(Continue reading)

David MENTRE | 1 Sep 2006 13:03
Favicon

Re: ONC RPC for PHP? Re: On web client, XML and ONC RPC and their integration with demexp

Hi,

Augustin <beginner2005 <at> masquilier.org> writes:

> For the sake of argument, what if leaving the server as is (using ONC RPC) and 
> creating a library coded in PHP (I cannot help with anything else) IS the 
> best technical and tactical choice?

I can't say.

> Do you mean "for" PHP (as in creating a PHP module coded in C) on "in" PHP (as 
> in coding a library in PHP that I could integrate into my Drupal module)?

I mean "in" PHP.

> How hard could that be?
> Well, the two important questions are:
> 1) what would be the most quickly implemented? A ONC implementation script 
> coded in PHP, or a rework of your server to handle XML calls?
> 2) again, because it is important: what is the best tactical choice over the 
> long term?

Having XML RPC is probably a good tactical option, as a lot of people
like this protocol.

> From what I understand, the data itself is encoded in XDR:
> http://www.ietf.org/rfc/rfc1832.txt

Yep.

(Continue reading)

Frederic Lehobey | 1 Sep 2006 09:04
Picon
Favicon

Re: ONC RPC for PHP? Re: On web client, XML and ONC RPC and their integration with demexp

Hi,

On Fri, Sep 01, 2006 at 12:44:37PM +0800, Augustin wrote:

> For the sake of argument, what if leaving the server as is (using ONC RPC) and 
> creating a library coded in PHP (I cannot help with anything else) IS the 
> best technical and tactical choice?

> How hard could that be?
> Well, the two important questions are:
> 1) what would be the most quickly implemented? A ONC implementation script 
> coded in PHP, or a rework of your server to handle XML calls?
> 2) again, because it is important: what is the best tactical choice over the 
> long term?

I can hardly answer this question, but one interesting point is that
it would provide a new feature to PHP developpers.

> > Moreover, beside demexp, I don't think a lot of people in the PHP 
> > community are eager to use ONC RPC.
> 
> Most probably true.

It mitigates what I have said just above. But have you looked at the
way XML-RPC are (technically) handled in PHP? Would it be possible to
adapt this existing work?

> As you see, I am willing to have a look at this approach. 

This is precious.
(Continue reading)

Augustin | 3 Sep 2006 08:36

Re: ONC RPC for PHP? Re: On web client, XML and ONC RPC and their integration with demexp

Hi Frédéric,

Thanks for stopping by and cheering us up :)

On Friday 01 September 2006 03:04 pm, Frederic Lehobey wrote:
> It mitigates what I have said just above. But have you looked at the
> way XML-RPC are (technically) handled in PHP? Would it be possible to
> adapt this existing work?

Yes, I did start. I had to, anyway, because if it was not ONC RPC, it would be 
XML RPC.

Anyway, the point is moot, now: it seems that David has chosen the proxy 
solution, so I don't need to care at all about ONC RPC.

David's choice actually make my job easier :)

Thanks,

Augustin.

--

-- 
http://www.wechange.org/
Because we and the world need to change.

http://www.reuniting.info/
Intimate Relationships, peace and harmony in the couple.

http://www.gnosis-usa.com/
Revolutionary Psychology, White Tantrism, Dream Yoga...
(Continue reading)

Augustin | 31 Aug 2006 20:16

Re: On web client, XML and ONC RPC and their integration with demexp


Hi David,

Thank you for all the time you have put into finding a solution to our RPC 
problem.

I don't have much specific information to share. I can only make a few general 
comments.

To start with, it is obvious that the choice at the end is yours to make. 
Whatever is decided, it is more than likely that you will be the one to have 
to implement it.

I will do my best to help, but really, this is not my area of expertise. 
I can code in PHP (fairly well, but I still can improve: I am an amateur, not 
a professional), but I CANNOT code a PHP module in C.

If you did come up with a solution that requires me to make significant 
changes to my development setup, I can do it (with some help, if needed). For 
example, if you did come up with a new PHP module, I can learn how to compile 
PHP so that it includes  the new module.
But in such a scenario, I would be more worried about the long term 
consequences of such a choice. I would be happy to code the Drupal client on 
my own for a few months, but if the difficulty in  setting up a development 
platform becomes a barrier for other developers to join me in my coding 
effort, we loose a bit part of the interest in choosing a CMS in PHP (namely, 
the number of PHP developers available).

On Thursday 31 August 2006 07:48 pm, David MENTRE wrote:
> Hello,
(Continue reading)

David MENTRE | 1 Sep 2006 12:43
Favicon

Re: On web client, XML and ONC RPC and their integration with demexp

Hello Augustin,

Augustin <beginner2005 <at> masquilier.org> writes:

> The Drupal API is well documented:
> http://api.drupal.org/apis/HEAD/xmlrp

Thank you for the pointers.

> Also how difficult would it be to set up a server for development?

You mean, a demexp server. Quite easy with a static binary or with
Thomas's Ubuntu and Debian packages, a nightmare from sources.

I can easily provide a statically linked version if needed.

> Most of the posts I found discussing the relative merits of the two standards 
> date back to the last 1990s. It seems that this century, everybody accepts 
> XML RPC as the web standard. 

This is not because everybody does the same thing that everybody is
right. :-)

> So, why not use XML RPC only, and announce that once the official server is 
> upgraded, it will stop replying to ONC RP Calls?

Because:

 1. the current code is debugged and tested, with non regression
    tests. Starting from scratch would be a big overhead;
(Continue reading)


Gmane