/**
  * Test request/response encoding (alternate encoding)
  */
 public function testRequestResponseEncoding2()
 {
     $this->_server->setEncoding('ISO-8859-1');
     $response = $this->_server->handle();
     $request = $this->_server->getRequest();
     $this->assertEquals('ISO-8859-1', $request->getEncoding());
     $this->assertEquals('ISO-8859-1', $response->getEncoding());
 }
Example #2
0
 /**
  * Run webservice
  *
  * @return Mage_Api_Model_Server_Adapter_Xmlrpc
  */
 public function run()
 {
     $apiConfigCharset = Mage::getStoreConfig("api/config/charset");
     $this->_xmlRpc = new Zend_XmlRpc_Server();
     $this->_xmlRpc->setEncoding($apiConfigCharset)->setClass($this->getHandler());
     $this->getController()->getResponse()->clearHeaders()->setHeader('Content-Type', 'text/xml; charset=' . $apiConfigCharset)->setBody($this->_xmlRpc->handle());
     return $this;
 }