<?php ini_set("soap.wsdl_cache_enabled", 0); ini_set("soap.wsdl_cache_dir", "/tmp"); ini_set("soap.wsdl_cache_ttl", 86400); if (isset($_GET['wsdl'])) { $autodiscover = new Zend_Soap_AutoDiscover(); $autodiscover->setBindingStyle(array('style' => 'rpc')); $autodiscover->setOperationBodyStyle(array('use' => 'literal')); $autodiscover->setClass('ProviderWebServiceSyncUnits'); $data = file_get_contents('php://input'); $autodiscover->handle($data); } else { $server = new Zend_Soap_Server(__URLSERVERAPP__ . '/webservices/unidades/server.php?wsdl', array('cache_wsdl' => false)); $server->setClass('ProviderWebServiceSyncUnits'); $server->setPersistence(SOAP_PERSISTENCE_REQUEST); $data = file_get_contents('php://input'); $server->handle($data); }
public function testGetPersistence() { $server = new Zend_Soap_Server(); $this->assertNull($server->getPersistence()); $server->setPersistence(SOAP_PERSISTENCE_SESSION); $this->assertEquals(SOAP_PERSISTENCE_SESSION, $server->getPersistence()); }
require_once '../library/Shift8.php'; /** * While trying to develop the Soap extension for Shift8, I needed a way to debug * the events occuring to the remote asterisk, thus the Debug Listener and the * Syslog debug listener */ require_once '../library/Debug/Listener/Syslog.php'; if (isset($_GET['wsdl'])) { $autodiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex'); $autodiscover->setOperationBodyStyle(array('use' => 'literal', 'namespace' => 'http://' . $_SERVER['HTTP_HOST'])); /* * Does not work with PHP Soap Client. Might be required for .NET clients * $autodiscover->setBindingStyle( array( 'style' => 'document', 'transport' => 'http://schemas.xmlsoap.org/soap/http' ) ); */ $autodiscover->setClass('Shift8'); $autodiscover->handle(); } else { session_start(); $wsdl = sprintf('http://%s%s?wsdl', $_SERVER['HTTP_HOST'], $_SERVER['SCRIPT_NAME']); $soap = new Zend_Soap_Server($wsdl); $soap->setClass('Shift8', $config['asterisk'], $config['manager'], $config['secret'], false, new Shift8_Debug_Listener_Syslog()); $soap->setPersistence(SOAP_PERSISTENCE_SESSION); $soap->registerFaultException('Shift8_Exception'); $response = $soap->handle(); }
public function testGetPersistence() { if (!extension_loaded('soap')) { $this->markTestSkipped('SOAP Extension is not loaded'); } $server = new Zend_Soap_Server(); $this->assertNull($server->getPersistence()); $server->setPersistence(SOAP_PERSISTENCE_SESSION); $this->assertEquals(SOAP_PERSISTENCE_SESSION, $server->getPersistence()); }