コード例 #1
0
ファイル: ServerTest.php プロジェクト: vicfryzel/zf
 public function testEncoding()
 {
     $server = new Zend_Soap_Server();
     $this->assertNull($server->getEncoding());
     $server->setEncoding('ISO-8859-1');
     $this->assertEquals('ISO-8859-1', $server->getEncoding());
     try {
         $server->setEncoding(array('UTF-8'));
         $this->fail('Non-string encoding values should fail');
     } catch (Exception $e) {
         // success
     }
 }
コード例 #2
0
ファイル: ServerTest.php プロジェクト: lortnus/zf1
 public function testEncoding()
 {
     if (!extension_loaded('soap')) {
         $this->markTestSkipped('SOAP Extension is not loaded');
     }
     $server = new Zend_Soap_Server();
     $this->assertNull($server->getEncoding());
     $server->setEncoding('ISO-8859-1');
     $this->assertEquals('ISO-8859-1', $server->getEncoding());
     try {
         $server->setEncoding(array('UTF-8'));
         $this->fail('Non-string encoding values should fail');
     } catch (Exception $e) {
         // success
     }
 }
コード例 #3
0
 /**
  * Método executado após qualquer action.
  * Responsável por instanciar a classe de soap correta e configurala
  * disponibilizando assim o serviço para ser consumido.
  */
 public function postDispatch()
 {
     $request = $this->getRequest();
     $params = $request->getParams();
     $router = Zend_Controller_Front::getInstance()->getRouter();
     if ($this->_hasParam('wsdl')) {
         $server = new Zend_Soap_AutoDiscover();
     } else {
         $server = new Zend_Soap_Server();
         $url = "{$request->getScheme()}://{$request->getHttpHost()}{$router->assemble($params)}";
         $server->setUri($url);
         $server->setEncoding('ISO-8859-1');
     }
     $server->setClass($this->serviceClass);
     $server->handle();
 }