php5中XML-RPC函数的使用
pos($response, ''<?xml''); $str = substr($response, $pos); $tmp = xmlrpc_decode($str); print_r($tmp); /* do something with $tmp e.g. print it */ /* servertest.php */ $server = xmlrpc_server_create(); /* register the ''external'' name and then the ''internal'' name */ $request = $HTTP_RAW_POST_DATA; // no you don''t need ''always on'', and no Copyright © 2008 chengduxinxi.com All Rights Reserved PHP编程开发 由朝夕网络维护
/* the parameters here are ''server, xml-string and user data''. There''s supposed to be an optional ''output options'' array too, but I can''t get it working :( hence header() call */ xmlrpc_server_destroy($server); 运行一下,看看显示的数组的样式,这样处理起来就舒服多了. 明白了这个,别闲着,看看php5自带的"SOAP Functions",使用方法和工作原理,大同小异啊. |
