note 47017 added to function.xmlrpc-set-type
| From: | shem.etkDOTca | Date: | Sat, 30 Oct 2004 21:23:01 +0000 |
| Subject: | note 47017 added to function.xmlrpc-set-type | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-79374@lists.php.net to get a copy of this message | ||
Once you use the xmlrpc_set_type function, the data is encoded into a PHP object. In your XMLRPC
server, in order to access the data you must be able to access the necessary part of the object.
So.. to expend on the example above:
<---------- CLIENT ---------->
$string = "My logging event.";
$date = "20030115T12:22:37"; // Must be this format
$binary = fread($fp, 128);
xmlrpc_set_type(&$date, "datetime");
xmlrpc_set_type(&$binary, "base64");
$xmlrpcReq = xmlrpc_encode_request("log.data", array($string, $date, $binary));
In order to retrieve the binary file data you would need to get the scalar portion of the object:
<---------- SERVER ------------>
$string=$params[0];
$date_obj=$params[1];
$binary_obj=$params[2];
$date=$date_obj->scalar;
$binary_data=$binary_obj->scalar;
// Then you can proceed to write the binary
fwrite($handle,$binary_data);
----
Manual Page -- http://www.php.net/manual/en/function.xmlrpc-set-type.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47017
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47017&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47017&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47017&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47017&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47017&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47017&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47017&report=yes
Search -- http://master.php.net/manage/user-notes.php