Fix ArrayIterator interface implementation; remove usage of arraysize(), structsize...
[plcapi.git] / src / Request.php
index 7d5a8a0..2c47940 100644 (file)
@@ -2,9 +2,10 @@
 
 namespace PhpXmlRpc;
 
+use PhpXmlRpc\Helper\Charset;
 use PhpXmlRpc\Helper\Http;
-use PhpXmlRpc\Helper\XMLParser;
 use PhpXmlRpc\Helper\Logger;
+use PhpXmlRpc\Helper\XMLParser;
 
 class Request
 {
@@ -52,7 +53,7 @@ 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) .
@@ -356,6 +357,16 @@ class Request
         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.
      *