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; }
/** * 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(); }
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()); }
* 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 <*****@*****.**> */ // 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(); }
/** * 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(); } }
$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(); } ?>