namespace PhpXmlRpc;
+use PhpXmlRpc\Helper\Charset;
use PhpXmlRpc\Helper\Http;
-use PhpXmlRpc\Helper\XMLParser;
use PhpXmlRpc\Helper\Logger;
+use PhpXmlRpc\Helper\XMLParser;
class Request
{
$this->content_type = 'text/xml';
}
$this->payload = $this->xml_header($charsetEncoding);
- $this->payload .= '<methodName>' . $this->methodname . "</methodName>\n";
+ $this->payload .= '<methodName>' . Charset::instance()->encodeEntities($this->methodname, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</methodName>\n";
$this->payload .= "<params>\n";
foreach ($this->params as $p) {
$this->payload .= "<param>\n" . $p->serialize($charsetEncoding) .
$r = new Response(0, PhpXmlRpc::$xmlrpcerr['invalid_return'],
PhpXmlRpc::$xmlrpcstr['invalid_return']);
} else {
- if ($this->debug) {
+ if ($this->debug > 1) {
Logger::instance()->debugMessage(
"---PARSED---\n".var_export($xmlRpcParser->_xh['value'], true)."\n---END---"
);
return $r;
}
+
+ /**
+ * Kept the old name even if Request class was renamed, for compatibility.
+ *
+ * @return string
+ */
+ public function kindOf()
+ {
+ return 'msg';
+ }
+
+ /**
+ * Enables/disables the echoing to screen of the xmlrpc responses received.
+ *
+ * @param integer $in values 0, 1, 2 are supported
+ */
+ public function setDebug($in)
+ {
+ $this->debug = $in;
+ }
}