本文整理汇总了PHP中Zend_Soap_Server::setObject方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Soap_Server::setObject方法的具体用法?PHP Zend_Soap_Server::setObject怎么用?PHP Zend_Soap_Server::setObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Soap_Server
的用法示例。
在下文中一共展示了Zend_Soap_Server::setObject方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction()
{
if ($this->getRequest()->query->has("wsdl")) {
$soap = new \Zend_Soap_AutoDiscover("Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex");
$soap->setUri($this->getRequest()->getUriForPath("/search"))->setClass('\\Server\\CodeSearchBundle\\Libraries\\SoapFacade');
} else {
$soap = new \Zend_Soap_Server($this->getRequest()->getUri() . "?wsdl");
$soap->setObject($this->get('SoapFacade'));
}
$response = new Response();
$response->headers->set('Content-Type', 'text/xml; charset=UTF-8');
ob_start();
$soap->handle();
$response->setContent(ob_get_clean());
return $response;
}
示例2: soap
/**
* Accept the request of the clients
*
* @param string $classname
*/
public function soap($classname)
{
if (empty($classname)) {
return false;
}
list($app, $module, $class) = explode("_", $classname);
// initialize server and set URI
$optionsoap = array('location' => "http://" . $_SERVER['HTTP_HOST'] . "/" . strtolower($class) . ".wsld", 'uri' => 'urn:' . $classname);
$server = new Zend_Soap_Server(null, $optionsoap);
// set SOAP service class
$server->setClass($classname);
// Bind already initialized object to Soap Server
$server->setObject(new $classname());
$server->setReturnResponse(false);
// register exceptions for generating SOAP faults
$server->registerFaultException(array('Shineisp_Api_Exceptions'));
// handle request
$server->handle();
}
示例3: testGetFunctionsWithObjectAttached
public function testGetFunctionsWithObjectAttached()
{
$server = new Zend_Soap_Server();
$server->setObject(new Zend_Soap_Server_TestClass());
$this->assertEquals(array('testFunc1', 'testFunc2', 'testFunc3', 'testFunc4', 'testFunc5'), $server->getFunctions());
}
示例4: dirname
* external APPs to allow remote access.
*
* Please read the following page to know how this server works:
* http://framework.zend.com/manual/en/zend.soap.server.html
*
* @author Kevin Papst <kpapst@gmx.net>
*/
// Bootstrap Kimai
require dirname(__FILE__) . "/../includes/basics.php";
ini_set('soap.wsdl_cache_enabled', 0);
// @TODO
ini_set('soap.wsdl_cache_dir', APPLICATION_PATH . '/temporary/');
// @TODO
ini_set('soap.wsdl_cache', WSDL_CACHE_NONE);
// WSDL_CACHE_DISK
ini_set('soap.wsdl_cache_ttl', 0);
// cache lifetime
// @TODO check what works better, with or without?
//$soapOpts = array('soap_version' => SOAP_1_2, 'encoding' => 'UTF-8'/*, 'uri' => $wsdlUrl*/);
$soapOpts = array();
if (isset($_GET['wsdl']) || isset($_GET['WSDL'])) {
$autodiscover = new Zend_Soap_AutoDiscover();
$autodiscover->setClass('Kimai_Remote_Api');
$autodiscover->handle();
} else {
$wsdlUrl = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . '?wsdl';
$server = new Kimai_Remote_Api();
$soap = new Zend_Soap_Server($wsdlUrl, $soapOpts);
$soap->setObject($server);
$soap->handle();
}
示例5: rgProductOfferedAction
/**
* Fetches all the products for RG
*/
public function rgProductOfferedAction()
{
$params = Zend_Registry::get('params');
//$this->enforceSecurity();
if (isset($_GET['wsdl'])) {
$autoDiscover = new Zend_Soap_AutoDiscover();
$autoDiscover->setUri($params->homelet->domain . '/soap/rg-product-offered');
$autoDiscover->setClass('Service_Core_RGProductOfferedAccessor');
$autoDiscover->handle();
} else {
// Disable all layouts
$this->getHelper('viewRenderer')->setNoRender(true);
// initialize server and set URI
$server = new Zend_Soap_Server(null, array('uri' => $params->homelet->domain . '/soap/rg-product-offered'));
// set SOAP service class
$server->setClass('Service_Core_RGProductOfferedAccessor');
$server->setObject(new Manager_Core_RGProductOffered());
// handle request
$server->handle();
}
}
示例6: VerifyStream
$Message = com_create_guid();
return $Message;
}
/**
*
* @param string $UserID
* @param string $StreamID
* @return boolean
*/
public function VerifyStream($UserID, $StreamID)
{
//check if UserID and StreamID are vaild
return true;
}
}
//Subscriber
if (isset($_GET['wsdl'])) {
$autodiscover = new Zend_Soap_AutoDiscover();
$autodiscover->setClass("MyService");
$autodiscover->handle();
//Publisher
} else {
$server = new Zend_Soap_Server($serviceURL . "?wsdl");
$server->setClass('MyService');
$server->setObject(new MyService());
$server->handle();
}
?>