使用Zend的xmlrpc Client进行XML解析

时间:2011-10-04 15:15:54

标签: php xml zend-framework xml-parsing

我正在尝试使用名为xmlrpc的zend库从xml文件中检索,该文件包含酒店预订列表。这是代码:

$client = new Zend_XmlRpc_Client('http://username:password@distribution-xml.booking.com/xml-rpc');
$service = $client->getProxy();
$hotels = $service->bookings->getHotels();

如何将一些参数传递给getHotels方法?

1 个答案:

答案 0 :(得分:1)

我做到了!只需在关联数组中传递参数,如下所示:

$client = new Zend_XmlRpc_Client('http://username:password@distribution-xml.booking.com/xml-rpc');
$content = array(
    'paramname' => array(paramvalues)
 );
 $service = $client->getProxy(); 
 $hotels=$service->bookings->getHotels($content);

;)