Re: XML_RPC for PHP5 new Iteration
| From: | Sergio Carvalho | Date: | Tue, 02 Nov 2004 16:23:56 +0000 |
| Subject: | Re: XML_RPC for PHP5 new Iteration | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-34194@lists.php.net to get a copy of this message | ||
Davey wrote:
Sergio, I have been thinking about a PHP5 only XML-RPC for a few weeks.Take a look at the current code. Its virtually ready, bar testing: http://files.sergiocarvalho.com/2004/XML_RPC/ Tell me if it does not satisfy any of your requisites.
It is my opinion that if we do this, it MUST follow the same setup as the PHP5 SOAP extension.I'm not familiar with the PHP5 SOAP extension, but a common RPC interface is an interesting objective. I'm not convinced that using SOAP as the target interface for such an objective is the way to go. XML-RPC is a lot simpler than SOAP, as is REST. Since simplicity is the reason for their respective successes, its not acceptable to discard it. I'll take a look at the SOAP code, and write down some thoughts on a common RPC interface.
I have just completed (assuming no bugs and no new ideas) my SOAP stuff [1] for cerebral cortex, which will allow you to do one of the following: a) Take a PHP file and automatically expose itThis is impossible in XML-RPC. XML-RPC is a procedural interface. Using just the XML-RPC spec, you can't expose an OO interface, as there is no notion of object instance-specific methods. XML-RPC exposes only procedures. You could obviously build on it, and compose an object-oriented XML-RPC, but this is out of the scope of the basic XML-RPC PEAR package.
b) take a WSDL file and automatically do one of the following: i) Generate a PHP class skeleton ii) Create a SOAP Server and register the class/methods with itWSDL is pretty much a SOAP thing. It's the method used to sidestep the 'on the wire' complexity of SOAP. You can do these without WSDL in XML-RPC (as in REST). For (i) you just need a proxy class presenting a façade for the remote methods, constructed by the package on the fly. For (ii) you just need a properly documented (phpdoc) PHP class. The XML-RPC package will build the descriptive interface from there. Check the docs here: http://files.sergiocarvalho.com/2004/XML_RPC/docs/XML_RPC2/XML_RPC2_Server_MethodHandler.html and here: http://files.sergiocarvalho.com/2004/XML_RPC/docs/XML_RPC2/XML_RPC2_Server_StaticMethodHandler.html
I am thinking of using this code to automate the current XML-RPC package and using __call() to make it work like the PHP5 SOAP extension.The current XML-RPC package makes no use of the xmlrpc extension or any of the current XML parsing abilities of PHP5. Both I and Greg, in separate approaches, decided to scrap it. That's how the current code is written from scratch. Cheers, Sérgio