[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ONC RPC for PHP? Re: [Demexp-dev] On web client, XML and ONC RPC and the
From: |
Augustin |
Subject: |
ONC RPC for PHP? Re: [Demexp-dev] On web client, XML and ONC RPC and their integration with demexp |
Date: |
Fri, 1 Sep 2006 12:44:37 +0800 |
User-agent: |
KMail/1.8.2 |
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
> path.
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?
> Moreover, beside demexp, I don't think a lot of people in the PHP
> community are eager to use ONC RPC.
Most probably true.
Now, what would it take to create an implementation in PHP?
First, I need to understand what ONC RPC exactly is.
From what I understand, the data itself is encoded in XDR:
http://www.ietf.org/rfc/rfc1832.txt
which is then passed to ONC which will pass the data over to the server/client
and dialog with it:
http://tools.ietf.org/html/rfc1831
and the whole 'dialog' is transported over the net using any transport
protocol, e.g. http.
So, we have three layers, right?
1) XDR data
2) ONC dialog
3) HTTP transport
I am not too worried about the XDR bit: how difficult can it be to put a
string together, using a well defined convention? (but as you pointed out,
the devil might be in the details).
What I couldn't figure out is the transport. It seems that for each php
project I participate in, I learn a new major skill. Demexp forces me to
learn about a whole area where I have no previous experience: Remote
Procedure Calls...
It turns out that Drupal has it own HTTP request wrapper function (it
shouldn't come as a surprise really):
http://api.drupal.org/api/HEAD/function/drupal_http_request
http://php.net/fsockopen
Supposing I have the XDR data and its ONC wrapper right, I can just use this
to contact the server, get a reply, and finish displaying the page called by
the web interface user, no?
This function can be used if the client wants to "call" the server and get a
reply to a particular question.
What I am not yet clear about, is how would the server "call" the client in
case some events happen that the client needs to be aware of.
The other thing I am not too sure about is the relation between the XDR layer
and the ONC layer.
Browsing the standard description doesn't help much:
""11.2 The RPC Language Specification
The RPC language is identical to the XDR language defined in RFC
1014, except for the added definition of a "program-def"
""
http://tools.ietf.org/html/rfc1831
As you see, I am willing to have a look at this approach.
Most importantly, you can witness the extent of my ignorance in this
particular domain, but I am willing to learn.
The two main question remain for you to answer:
1) which approach would be quicker to implement?
2) what is the best tactical choice?
I don't feel competent enough to answer any of those two questions.
David (and others): I am waiting for you to make a decision.
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...
http://www.masquilier.org/
Condorcet, Approval alternative, better voting methods.
- ONC RPC for PHP? Re: [Demexp-dev] On web client, XML and ONC RPC and their integration with demexp,
Augustin <=