cvs: pecl /http/lib XmlRpcClient.php

From: Date: Tue, 10 Oct 2006 19:34:52 +0000
Subject: cvs: pecl /http/lib XmlRpcClient.php
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-6476@lists.php.net to get a copy of this message
mike Tue Oct 10 19:34:52 2006 UTC Modified files: /pecl/http/lib XmlRpcClient.php Log: - a service implemented with libxmlrpc-c3 chokes on a request content type other than sole "text/xml" http://cvs.php.net/viewvc.cgi/pecl/http/lib/XmlRpcClient.php?r1=1.5&r2=1.6&diff_format=u Index: pecl/http/lib/XmlRpcClient.php diff -u pecl/http/lib/XmlRpcClient.php:1.5 pecl/http/lib/XmlRpcClient.php:1.6 --- pecl/http/lib/XmlRpcClient.php:1.5 Mon Sep 25 08:27:32 2006 +++ pecl/http/lib/XmlRpcClient.php Tue Oct 10 19:34:52 2006 @@ -2,7 +2,7 @@ /** * XMLRPC Client, very KISS - * $Id: XmlRpcClient.php,v 1.5 2006/09/25 08:27:32 mike Exp $ + * $Id: XmlRpcClient.php,v 1.6 2006/10/10 19:34:52 mike Exp $ * * NOTE: requires ext/xmlrpc * @@ -22,7 +22,7 @@ * @copyright Michael Wallner, <mike@iworks.at> * @license BSD, revised * @package pecl/http - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ */ class XmlRpcClient { @@ -54,7 +54,7 @@ * @param string $namespace RPC namespace * @param array $options HttpRequest options */ - public function __construct($url, $namespace = '', array $options = null) + public function __construct($url, $namespace = '', array $options = array()) { $this->__request = new HttpRequest($url, HttpRequest::METH_POST, $options); $this->__namespace = $namespace; @@ -70,15 +70,14 @@ */ public function __call($method, array $params) { - if ($this->__namespace) { + if (strlen($this->__namespace)) { $method = $this->__namespace .'.'. $method; } - $this->__request->setContentType("text/xml; charset=". $this->__encoding); + $this->__request->setContentType("text/xml"); $this->__request->setRawPostData( xmlrpc_encode_request($method, $params, array("encoding" => $this->__encoding))); - $this->__request->send(); - $response = $this->__request->getResponseMessage(); + $response = $this->__request->send(); if ($response->getResponseCode() != 200) { throw new Exception( $response->getResponseStatus(),

« previous php.pecl.cvs (#6476) next »