[dev] Proposal for change to Horde's XML-RPC service

Jan Schneider jan at horde.org
Fri Jun 23 00:42:02 PDT 2006


Zitat von Ben Klang <ben at alkaloid.net>:

> 1) Create a reserved variable name that is recognized by the XML-RPC
> driver as a file upload.  The variable would be a struct and have some
> kind of reserved name like "_fileupload" or similar to avoid conflicts
> with application variable names.  This has the disadvantage of being a
> "one-off" in the sense that the XML-RPC driver today does not do any
> processing on the contents of the POSTed data.  It instead immediately
> hands it off to the called method for processing.

I don't see how this is much different from handling the file data  
inside the API methods, beside that you do the base64 decoding in the  
RPC driver, not in the api.

> 2) Modify the XML-RPC spec to recognize a special file upload tag.
> Unless we can get the buy-in of the XML-RPC community I would prefer to
> avoid this route as I'm not usually one to go breaking accepted
> standards.  It does, however, have the benefit of being the "cleanest"
> approach in my mind as it would be unambiguous to the receiving
> application what should be done with the data (in Horde's/PHP's case
> that means decoding the Base64 data and writing it to a temp file to be
> passed to higher level methods as HTTP form processing does now).

The XMLRPC spec is pretty set in stone, don't expect any changes in  
the future. And even if there were some, they would have to be  
implemented in the php extension.

I think you have two options. Either handle the base64 decoding in the  
API methods. This really isn't a bad choice because this is not much  
work or overhead, and adding a new method or paramter is a matter of  
minutes.
Or use SOAP. SOAP already supports attachments, though we don't use  
them in Horde's RPC server yet. But at least there is a well defined  
standard you could build on.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the dev mailing list