本文整理汇总了PHP中Zend_Soap_Server::setPersistence方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Soap_Server::setPersistence方法的具体用法?PHP Zend_Soap_Server::setPersistence怎么用?PHP Zend_Soap_Server::setPersistence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Soap_Server
的用法示例。
在下文中一共展示了Zend_Soap_Server::setPersistence方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?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);
}
示例2: testGetPersistence
public function testGetPersistence()
{
$server = new Zend_Soap_Server();
$this->assertNull($server->getPersistence());
$server->setPersistence(SOAP_PERSISTENCE_SESSION);
$this->assertEquals(SOAP_PERSISTENCE_SESSION, $server->getPersistence());
}
示例3: sprintf
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();
}
示例4: testGetPersistence
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());
}