示例#1
1
<?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);
}
    function testAddFunctionMultiple()
    {
        $server = new Zend_Soap_AutoDiscover();
        $server->addFunction('Zend_Soap_AutoDiscover_TestFunc');
        $server->addFunction('Zend_Soap_AutoDiscover_TestFunc2');
        $server->addFunction('Zend_Soap_AutoDiscover_TestFunc3');
        $server->addFunction('Zend_Soap_AutoDiscover_TestFunc4');
        $server->addFunction('Zend_Soap_AutoDiscover_TestFunc5');
        $server->addFunction('Zend_Soap_AutoDiscover_TestFunc6');
        $server->addFunction('Zend_Soap_AutoDiscover_TestFunc7');
        $server->addFunction('Zend_Soap_AutoDiscover_TestFunc9');
        $dom = new DOMDocument();
        ob_start();
        $server->handle();
        $dom->loadXML(ob_get_contents());
        $dom->save(dirname(__FILE__) . '/addfunction2.wsdl');
        ob_end_clean();
        $parts = explode('.', basename($_SERVER['SCRIPT_NAME']));
        $name = $parts[0];
        $wsdl = '<?xml version="1.0"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://' . $_SERVER['PHP_SELF'] . '" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" name="' . $name . '" targetNamespace="http://' . $_SERVER['PHP_SELF'] . '"><portType name="' . $name . 'Port"><operation name="Zend_Soap_AutoDiscover_TestFunc"><input message="tns:Zend_Soap_AutoDiscover_TestFuncRequest"/><output message="tns:Zend_Soap_AutoDiscover_TestFuncResponse"/></operation><operation name="Zend_Soap_AutoDiscover_TestFunc2"><input message="tns:Zend_Soap_AutoDiscover_TestFunc2Request"/><output message="tns:Zend_Soap_AutoDiscover_TestFunc2Response"/></operation><operation name="Zend_Soap_AutoDiscover_TestFunc3"><input message="tns:Zend_Soap_AutoDiscover_TestFunc3Request"/><output message="tns:Zend_Soap_AutoDiscover_TestFunc3Response"/></operation><operation name="Zend_Soap_AutoDiscover_TestFunc4"><input message="tns:Zend_Soap_AutoDiscover_TestFunc4Request"/><output message="tns:Zend_Soap_AutoDiscover_TestFunc4Response"/></operation><operation name="Zend_Soap_AutoDiscover_TestFunc5"><input message="tns:Zend_Soap_AutoDiscover_TestFunc5Request"/><output message="tns:Zend_Soap_AutoDiscover_TestFunc5Response"/></operation><operation name="Zend_Soap_AutoDiscover_TestFunc6"><input message="tns:Zend_Soap_AutoDiscover_TestFunc6Request"/><output message="tns:Zend_Soap_AutoDiscover_TestFunc6Response"/></operation><operation name="Zend_Soap_AutoDiscover_TestFunc7"><input message="tns:Zend_Soap_AutoDiscover_TestFunc7Request"/><output message="tns:Zend_Soap_AutoDiscover_TestFunc7Response"/></operation><operation name="Zend_Soap_AutoDiscover_TestFunc9"><input message="tns:Zend_Soap_AutoDiscover_TestFunc9Request"/><output message="tns:Zend_Soap_AutoDiscover_TestFunc9Response"/></operation></portType><binding name="' . $name . 'Binding" type="tns:' . $name . 'Port"><soap:operation soapAction="http://' . $_SERVER['PHP_SELF'] . '#Zend_Soap_AutoDiscover_TestFunc9"/><soap:operation soapAction="http://' . $_SERVER['PHP_SELF'] . '#Zend_Soap_AutoDiscover_TestFunc7"/><soap:operation soapAction="http://' . $_SERVER['PHP_SELF'] . '#Zend_Soap_AutoDiscover_TestFunc6"/><soap:operation soapAction="http://' . $_SERVER['PHP_SELF'] . '#Zend_Soap_AutoDiscover_TestFunc5"/><soap:operation soapAction="http://' . $_SERVER['PHP_SELF'] . '#Zend_Soap_AutoDiscover_TestFunc4"/><soap:operation soapAction="http://' . $_SERVER['PHP_SELF'] . '#Zend_Soap_AutoDiscover_TestFunc3"/><soap:operation soapAction="http://' . $_SERVER['PHP_SELF'] . '#Zend_Soap_AutoDiscover_TestFunc2"/><soap:operation soapAction="http://' . $_SERVER['PHP_SELF'] . '#Zend_Soap_AutoDiscover_TestFunc"/><soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/><operation name="Zend_Soap_AutoDiscover_TestFunc"><input><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input><output><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output></operation><operation name="Zend_Soap_AutoDiscover_TestFunc2"><input><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input><output><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output></operation><operation name="Zend_Soap_AutoDiscover_TestFunc3"><input><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input><output><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output></operation><operation name="Zend_Soap_AutoDiscover_TestFunc4"><input><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input><output><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output></operation><operation name="Zend_Soap_AutoDiscover_TestFunc5"><input><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input><output><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output></operation><operation name="Zend_Soap_AutoDiscover_TestFunc6"><input><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input><output><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output></operation><operation name="Zend_Soap_AutoDiscover_TestFunc7"><input><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input><output><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output></operation><operation name="Zend_Soap_AutoDiscover_TestFunc9"><input><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input><output><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output></operation></binding><service name="' . $name . 'Service"><port name="' . $name . 'Port" binding="tns:' . $name . 'Binding"><soap:address location="http://' . $_SERVER['PHP_SELF'] . '"/></port></service><message name="Zend_Soap_AutoDiscover_TestFuncRequest"><part name="who" type="xsd:string"/></message><message name="Zend_Soap_AutoDiscover_TestFuncResponse"><part name="Zend_Soap_AutoDiscover_TestFuncReturn" type="xsd:string"/></message><message name="Zend_Soap_AutoDiscover_TestFunc2Request"/><message name="Zend_Soap_AutoDiscover_TestFunc3Request"/><message name="Zend_Soap_AutoDiscover_TestFunc3Response"><part name="Zend_Soap_AutoDiscover_TestFunc3Return" type="xsd:boolean"/></message><message name="Zend_Soap_AutoDiscover_TestFunc4Request"/><message name="Zend_Soap_AutoDiscover_TestFunc4Response"><part name="Zend_Soap_AutoDiscover_TestFunc4Return" type="xsd:boolean"/></message><message name="Zend_Soap_AutoDiscover_TestFunc5Request"/><message name="Zend_Soap_AutoDiscover_TestFunc5Response"><part name="Zend_Soap_AutoDiscover_TestFunc5Return" type="xsd:int"/></message><message name="Zend_Soap_AutoDiscover_TestFunc6Request"/><message name="Zend_Soap_AutoDiscover_TestFunc6Response"><part name="Zend_Soap_AutoDiscover_TestFunc6Return" type="xsd:string"/></message><message name="Zend_Soap_AutoDiscover_TestFunc7Request"/><message name="Zend_Soap_AutoDiscover_TestFunc7Response"><part name="Zend_Soap_AutoDiscover_TestFunc7Return" type="soap-enc:Array"/></message><message name="Zend_Soap_AutoDiscover_TestFunc9Request"><part name="foo" type="xsd:string"/><part name="bar" type="xsd:string"/></message><message name="Zend_Soap_AutoDiscover_TestFunc9Response"><part name="Zend_Soap_AutoDiscover_TestFunc9Return" type="xsd:string"/></message></definitions>
';
        $this->assertEquals($wsdl, $dom->saveXML(), "Bad WSDL generated");
        $this->assertTrue($dom->schemaValidate(dirname(__FILE__) . '/schemas/wsdl.xsd'), "WSDL Did not validate");
    }
示例#3
0
 public function soapAction()
 {
     $this->getResponse()->setHeader('Content-Type', 'text/xml;charset=utf-8', true);
     $this->_helper->viewRenderer->setNoRender();
     $this->_helper->layout()->disableLayout();
     $version = $this->getRequest()->getParam('version');
     $wsdl = $this->getRequest()->getParam('wsdl');
     $service = 'Auth_Service_Ldap';
     if ($wsdl) {
         $autodiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
         $autodiscover->setUri(ZendT_Url::getUri());
         $autodiscover->setClass($service);
         $autodiscover->handle();
     } else {
         if (!$version) {
             $version = '1_0';
         }
         $fileWsdl = APPLICATION_PATH . '/modules/auth/services/Ldap/version_' . $version . '.wsdl';
         if (file_exists($fileWsdl)) {
             $wsdl = str_replace("\\", "/", $fileWsdl);
         } else {
             $wsdl = ZendT_Url::getUri() . '?wsdl=1';
         }
         $server = new Zend_Soap_Server();
         $server->setWsdl($wsdl);
         $server->setClass($service);
         $server->handle();
     }
 }
示例#4
0
 public function soapAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     $this->_helper->layout()->disableLayout();
     $params = $this->getRequest()->getParams();
     if (!isset($params['version'])) {
         $params['version'] = '1.0';
     }
     $service = 'Ged_Service_FileSystem';
     $this->getResponse()->setHeader('Content-Type', 'text/xml;charset=utf-8', true);
     if (isset($params['wsdl'])) {
         $autodiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
         $autodiscover->setUri(ZendT_Url::getUri());
         $autodiscover->setClass($service);
         $autodiscover->handle();
     } else {
         $version = str_replace('.', '_', $params['version']);
         $names = explode('_', $service);
         $fileWsdl = APPLICATION_PATH . '/modules/' . strtolower($names[0]) . '/' . strtolower($names[1]) . 's/' . $names[2] . '/wsdl/' . $names[2] . '_v' . $version . '.wsdl';
         if (file_exists($fileWsdl)) {
             $wsdl = str_replace("\\", "/", $fileWsdl);
         }
         $server = new Zend_Soap_Server();
         $server->setWsdl($wsdl);
         $server->setClass($service);
         $server->handle();
     }
 }
 public function soapWSDL()
 {
     $vs_service = $this->request->config->get("site_host") . __CA_URL_ROOT__ . "/service.php/usercontent/UserContent/soap";
     $vo_autodiscover = new Zend_Soap_AutoDiscover(true, $vs_service);
     $vo_autodiscover->setClass('UserContentService', $this->request);
     $this->view->setVar("autodiscover", $vo_autodiscover);
     $this->render("usercontent_soap_wsdl.php");
 }
 public function processWSDL()
 {
     $autodiscover = new Zend_Soap_AutoDiscover(new Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence());
     $autodiscover->setClass('soapserverservice');
     $autodiscover->setUri($this->url('soapserver|soap|Server'));
     $autodiscover->handle();
     return _arNone();
 }
 public function soapWSDL()
 {
     if ($this->opb_disable) {
         return "";
     }
     $vs_service = $this->request->config->get("site_host") . __CA_URL_ROOT__ . "/service.php/accesscontrol/AccessControl/soap";
     $vo_autodiscover = new Zend_Soap_AutoDiscover(true, $vs_service);
     $vo_autodiscover->setClass('AccessControlService', $this->request);
     $this->view->setVar("autodiscover", $vo_autodiscover);
     $this->render("accesscontrol/accesscontrol_soap_wsdl.php");
 }
示例#8
0
 /**
  * Handle requests regarding users
  *
  * @return void
  */
 public function __call($function, $params)
 {
     $action = strtolower(str_replace('Action', '', $function));
     $class = 'ShortUrl_Api_' . ucfirst($action);
     if (!@(include_once str_replace('_', '/', $class) . '.php')) {
         throw new ShortUrl_Api_ClassNotFoundException($class);
     }
     if (isset($_GET['wsdl'])) {
         $autodiscover = new Zend_Soap_AutoDiscover();
         $autodiscover->setClass($class)->handle();
     } else {
         $soap = new Zend_Soap_Server($this->_getWsdl($action));
         $soap->setClass($class)->handle();
     }
 }
示例#9
0
 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;
 }
示例#10
0
 public function connectorAction()
 {
     $this->getHelper('viewRenderer')->setNoRender();
     $this->_helper->layout->disableLayout();
     $conf = Zend_Registry::get('config');
     if (isset($_GET['wsdl'])) {
         $autodiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence');
         $autodiscover->setClass('Logic_RemoteSiteConn');
         $this->getResponse()->setHeader('Content-Type', 'text/xml')->setBody($autodiscover->handle());
     } else {
         // pointing to the current file here
         $soap = new Zend_Soap_Server($conf['crossover']['webservice']['wsdl']);
         $soap->setClass('Logic_RemoteSiteConn');
         $soap->setSoapVersion(SOAP_1_2);
         $soap->handle();
     }
 }
示例#11
0
 /**
  * Show the WSDL file of a specific class 
  * 
  * @param string $classname
  */
 public function wsdl($classname)
 {
     //You can add Zend_Auth code here if you do not want
     //everybody can access the WSDL file.
     if (empty($classname)) {
         return false;
     }
     list($app, $module, $class) = explode("_", $classname);
     // initilizing zend autodiscover object.
     $wsdl = new Zend_Soap_AutoDiscover();
     // register SOAP service class
     $wsdl->setClass($classname);
     // set a SOAP action URI. here, SOAP action is 'soap' as defined above.
     $wsdl->setUri("http://" . $_SERVER['HTTP_HOST'] . "/" . strtolower($class) . ".soap");
     // handle request
     $wsdl->handle();
 }
 public function endpointAction()
 {
     // disable wsdl cache
     if (PIMCORE_DEVMODE) {
         ini_set("soap.wsdl_cache_enabled", "0");
     }
     // create classmappings
     $classMap = Webservice_Tool::createClassMappings();
     //        p_r($classMap); die();
     // create wsdl
     // @TODO create a cache here
     $strategy = new Zend_Soap_Wsdl_Strategy_Composite(array("object[]" => "Zend_Soap_Wsdl_Strategy_AnyType"), "Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex");
     $autodiscover = new Zend_Soap_AutoDiscover($strategy);
     $autodiscover->setClass('Webservice_Service');
     $wsdl = $autodiscover->toXml();
     //TODO: do we really want to normalize class names since we had to introduce request and response objects anyway?
     $wsdl = str_replace("Webservice_Data_", "", $wsdl);
     // normalize classnames
     $wsdlFile = PIMCORE_SYSTEM_TEMP_DIRECTORY . "/wsdl.xml";
     file_put_contents($wsdlFile, $wsdl);
     chmod($wsdlFile, 0766);
     // let's go
     if (isset($_GET["wsdl"])) {
         header("Content-Type: text/xml; charset=utf8");
         echo $wsdl;
     } else {
         Pimcore::setAdminMode();
         Document::setHideUnpublished(false);
         Object_Abstract::setHideUnpublished(false);
         Object_Abstract::setGetInheritedValues(false);
         try {
             $server = new Zend_Soap_Server($wsdlFile, array("cache_wsdl" => false, "soap_version" => SOAP_1_2, "classmap" => $classMap));
             $server->registerFaultException("Exception");
             $server->setClass("Webservice_Service");
             $server->handle();
         } catch (Exception $e) {
             Logger::log("Soap request failed");
             Logger::log($e);
             throw $e;
         }
     }
     exit;
 }
示例#13
0
 public function soapAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     $this->_helper->layout()->disableLayout();
     $params = $this->getRequest()->getParams();
     $service = 'ZendT_Mail_Service';
     $this->getResponse()->setHeader('Content-Type', 'text/xml;charset=utf-8', true);
     if (isset($params['wsdl'])) {
         $autodiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
         $autodiscover->setUri(ZendT_Url::getUri());
         $autodiscover->setClass($service);
         $autodiscover->handle();
     } else {
         $server = new Zend_Soap_Server();
         #$wsdl = ZendT_Url::getUri() . "?wsdl";
         $wsdl = APPLICATION_PATH . '/controllers/Mail_v1.wsdl';
         $server->setWsdl($wsdl);
         $server->setClass($service);
         $server->handle();
     }
 }
    function testAddFunctionMultiple()
    {
        $server = new Zend_Soap_AutoDiscover();
        $server->addFunction('Zend_Soap_AutoDiscover_TestFunc');
        $server->addFunction('Zend_Soap_AutoDiscover_TestFunc2');
        $server->addFunction('Zend_Soap_AutoDiscover_TestFunc3');
        $server->addFunction('Zend_Soap_AutoDiscover_TestFunc4');
        $server->addFunction('Zend_Soap_AutoDiscover_TestFunc5');
        $server->addFunction('Zend_Soap_AutoDiscover_TestFunc6');
        $server->addFunction('Zend_Soap_AutoDiscover_TestFunc7');
        $server->addFunction('Zend_Soap_AutoDiscover_TestFunc8');
        $dom = new DOMDocument();
        ob_start();
        $server->handle();
        $dom->loadXML(ob_get_contents());
        $dom->save(dirname(__FILE__) . '/addfunction.wsdl');
        ob_end_clean();
        $wsdl = '<?xml version="1.0"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://dummy.php" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" name="dummy" targetNamespace="http://dummy.php"><portType name="dummyPortType"><operation name="Zend_Soap_AutoDiscover_TestFunc"><input message="tns:Zend_Soap_AutoDiscover_TestFuncRequest"/><output message="tns:Zend_Soap_AutoDiscover_TestFuncResponse"/></operation></portType><binding name="dummyBinding" type="tns:dummyPortType"><soap:operation soapAction="http://dummy.php#Zend_Soap_AutoDiscover_TestFunc"/><soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/><operation name="Zend_Soap_AutoDiscover_TestFunc"><input><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input><output><soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output></operation></binding><service name="dummyService"><port name="dummyPort" binding="tns:dummyBinding"><soap:address location="http://dummy.php"/></port></service><message name="Zend_Soap_AutoDiscover_TestFuncRequest"><part name="who" type="xsd:string"/></message><message name="Zend_Soap_AutoDiscover_TestFuncResponse"><part name="Zend_Soap_AutoDiscover_TestFuncReturn" type="xsd:string"/></message></definitions>
';
        //$this->assertEquals($wsdl, $dom->saveXML(), "Bad WSDL generated");
        $this->assertTrue($dom->schemaValidate(dirname(__FILE__) . '/schemas/wsdl.xsd'), "WSDL Did not validate");
    }
示例#15
0
<?php

/**
 * index file
 *
 * PHP Version 5.3.0
 *
 * @category  PHP
 * @package   wsportfolio
 * @author    Sergio Alejandro Valencia Lopez
 * @license   http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version   SVN: $Id$
 *
 */
require_once 'class/Conf/Autoload.php';
Autoload::register(array(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'class', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'Request', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'Response', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'Params', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'Conf', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'Business'));
if (isset($_GET['wsdl'])) {
    include_once 'Zend/Soap/AutoDiscover.php';
    $autodiscover = new Zend_Soap_AutoDiscover(true);
    $autodiscover->setUri('http://127.0.0.1/webservice/index.php');
    $autodiscover->setClass('WebService');
    $autodiscover->handle();
} else {
    ini_set("soap.wsdl_cache_enabled", 0);
    $server = new SoapServer('wsdl/webservice.wsdl');
    $server->setClass('WebService');
    $server->setPersistence(SOAP_PERSISTENCE_SESSION);
    $server->handle();
}
示例#16
0
 public function autodiscoverWsdlDocument($wsClassName = null, $log = FALSE)
 {
     $wsClassName = self::generateWSClassName($wsClassName);
     $wsdlStrategy = new Zend_Soap_Wsdl_Strategy_Composite();
     $wsdlStrategy->connectTypeToStrategy('Logic_WebService_Object_Bonus[]', Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex);
     $wsdlStrategy->connectTypeToStrategy('Logic_WebService_Object_DepositData[]', Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex);
     $wsdlStrategy->connectTypeToStrategy('Logic_WebService_Handler_Response_Step[]', Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex);
     $wsdlStrategy->connectTypeToStrategy('Logic_WebService_Handler_Response_Option[]', Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex);
     $wsdlStrategy->connectTypeToStrategy('Logic_WebService_Object_DepositDuration[]', Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex);
     //$wsdlStrategy->connectTypeToStrategy('Logic_WebService_Handler_Response_Option', Zend_Soap_Wsdl_Strategy_AnyType);
     $wsdlStrategy->connectTypeToStrategy('float[]', Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence);
     $wsdlStrategy->connectTypeToStrategy('string[]', Zend_Soap_Wsdl_Strategy_AnyType);
     $autodisc = new Zend_Soap_AutoDiscover($wsdlStrategy);
     $autodisc->setClass($wsClassName);
     $autodisc->dump(APPLICATION_PATH . '/../tmp/' . $wsClassName . '.tmp');
     if (!is_readable(APPLICATION_PATH . '/../tmp/' . $wsClassName . '.tmp')) {
         throw new SoapFault('No "/../tmp/' . $wsClassName . '.tmp" or fail is unreadable', '007');
     }
     $return = file_get_contents(APPLICATION_PATH . '/../tmp/' . $wsClassName . '.tmp');
     if ($return === false && $log) {
         throw new SoapFault('Error during reading of WSDL, fail: "/../tmp/' . $wsClassName . '.tmp"', '008');
     }
     return $return;
 }
示例#17
0
     * Prints some test data.
     *
     * @param string $param2
     * @param string $param1
     * @param string $param3
     * @return string
     */
    function test($param2, $param1, $param3)
    {
        return 'test1 ' . $param1 . ' test2 ' . $param2 . ' test3 ' . $param3;
    }
    /**
     * Displays the Tiki_ComplexType data.
     *
     * @param Tiki_ComplexType $complex_param
     * @return string
     */
    function test_complex(Tiki_ComplexType $complex_param)
    {
        return $complex_param->param1 . ' =====> ' . $complex_param->param2;
    }
}
if (is_null($_GET['wsdl'])) {
    $server = new Zend_Soap_Server($_SERVER['SCRIPT_URI'] . '?wsdl');
    $server->setClass('Tiki_WebServices');
    $server->handle();
} else {
    $wsdl = new Zend_Soap_AutoDiscover();
    $wsdl->setClass('Tiki_WebServices');
    $wsdl->handle();
}
示例#18
0
/**
 * Endpoint voor de faxservice soap services
 */
ini_set('xdebug.remote_enable', 'off');
set_include_path(realpath(dirname(__FILE__) . '/../') . '/library/');
require_once 'Zend/Loader/Autoloader.php';
$loader = Zend_Loader_Autoloader::getInstance();
$loader->setFallbackAutoloader(true);
// todo live gegevens
$db = Zend_Db::factory('mysqli', array('host' => 'dev2.admin.netexpo.nl', 'username' => 'faxservicesoap', 'password' => 'fkXcn2di', 'dbname' => 'netexpo', 'charset' => 'utf8'));
Zend_Registry::set('db', $db);
// testen zonder soap
if (isset($_GET['nosoap']) == true) {
    $s = new ServicedeskFax();
    //var_dump($s->getAvailableFaxnumbers(31,10));
}
// testen met een client
if (isset($_GET['client']) == true) {
    $s = new SoapClient('http://' . $_SERVER['HTTP_HOST'] . '/' . $_SERVER['PHP_SELF'] . '?wsdl');
    //var_dump($s->getCountries());
}
if (isset($_GET['wsdl'])) {
    $autodiscover = new Zend_Soap_AutoDiscover();
    $autodiscover->setClass('ServicedeskFax');
    $autodiscover->handle();
} else {
    $soap = new Zend_Soap_Server('http://' . $_SERVER['HTTP_HOST'] . '/' . $_SERVER['PHP_SELF'] . '?wsdl');
    $soap->setClass('ServicedeskFax');
    $soap->handle();
}
示例#19
0
<?php

require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();
class SingleEntity
{
    /**
     * Alternative Entity
     * @var SingleEntity
     */
    public $AlternativeEntity = Null;
    /**
     * Single Entity
     *
     * @return SingleEntity
     */
    public function SingleEntity()
    {
        return new SingleEntity();
    }
}
$Discover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
$Discover->setClass('SingleEntity');
$Discover->handle();
 private function hadleWSDL()
 {
     $autodiscover = new Zend_Soap_AutoDiscover();
     $autodiscover->setClass('Webteam_Api_Service');
     $autodiscover->handle();
 }
示例#21
0
include_once 'Zend/Loader/Autoloader.php';
$loader = Zend_Loader_Autoloader::getInstance();
$loader->setFallbackAutoloader(true);
$loader->suppressNotFoundWarnings(false);
require_once "Zend/Soap/Wsdl.php";
require_once "Zend/Soap/Server.php";
require_once "Zend/Soap/AutoDiscover.php";
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();
        $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();
}
?>


示例#23
0
 private function hadleWSDL()
 {
     $autodiscover = new Zend_Soap_AutoDiscover();
     $autodiscover->setClass('Base_Soap_Soaptest');
     $autodiscover->handle();
 }
示例#24
0
	/**
	 * SOAP server
	 */
	public function soapAction() 
	{
		
		if( isset($_GET['wsdl']) ){
			$wsdl = new Zend_Soap_AutoDiscover();
			$wsdl->setClass('User_Service_User');
			$wsdl->handle();
		} else {
			$options = array( 'soap_version' => SOAP_1_1, 
			'uri' => 'http://front.zend.local/Wsserver/index/soap');
			
			$server = new Zend_Soap_Server( null, $options);
			$server->setClass('User_Service_User');
			$server->handle();
		}
	}
示例#25
0
文件: soap.php 项目: kimai/kimai
 * 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();
}
示例#26
0
文件: server.php 项目: pelif/studyWS
require_once "loadZend.php";
class MyClass
{
    /**
     * @param integer $num1
     * @param integer $num2
     * @return integer
     */
    public function Sum($num1, $num2)
    {
        return $num1 + $num2;
    }
    /**
     * @param integer $num1
     * @param integer $num2
     * @return integer
     */
    public function Sub($num1, $num2)
    {
        return $num2 - $num1;
    }
}
if (isset($_GET['wsdl'])) {
    $server = new Zend_Soap_AutoDiscover();
    $server->setClass("MyClass");
    $server->handle();
} else {
    $server = new Zend_Soap_Server("http://127.0.0.1/xmlgenerator/ws-zend02/server.php?wsdl");
    $server->setClass("MyClass");
    $server->handle();
}
示例#27
0
 /**
  * @group ZF-8948
  * @group ZF-5766
  */
 public function testRecursiveWsdlDependencies()
 {
     $autodiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
     $autodiscover->setClass('Zend_Soap_AutoDiscover_Recursion');
     $wsdl = $autodiscover->toXml();
     //  <types>
     //      <xsd:schema targetNamespace="http://localhost/my_script.php">
     //          <xsd:complexType name="Zend_Soap_AutoDiscover_Recursion">
     //              <xsd:all>
     //                  <xsd:element name="recursion" type="tns:Zend_Soap_AutoDiscover_Recursion"/>
     $path = '//wsdl:types/xsd:schema/xsd:complexType[@name="Zend_Soap_AutoDiscover_Recursion"]/xsd:all/xsd:element[@name="recursion" and @type="tns:Zend_Soap_AutoDiscover_Recursion"]';
     $this->assertWsdlPathExists($wsdl, $path);
 }
示例#28
0
<?php

// Define path to application directory
defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
defined('APPLICATION_ENV') || define('APPLICATION_ENV', getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development');
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(realpath(APPLICATION_PATH . '/../library'), get_include_path())));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
$application->getBootstrap()->bootstrap('db');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type, Authorization, Accept');
if (isset($_GET['wsdl'])) {
    $autodiscover = new Zend_Soap_AutoDiscover();
    $autodiscover->setClass('Application_Model_WebServices');
    $autodiscover->setBindingStyle(array('style' => 'rpc'));
    $autodiscover->handle();
} else {
    ini_set("soap.wsdl_cache_enabled", "0");
    $server = new Zend_Soap_Server();
    $server->setOptions(array('soap_version' => SOAP_1_2, 'actor' => 'http://localhost/AgendaTelefonicaPHPSOAP/public/webservice.php', 'encoding' => 'UTF-8'));
    $server->setWsdl('http://localhost/AgendaTelefonicaPHPSOAP/public/webservice.php?wsdl');
    $server->setClass('Application_Model_WebServices');
    $server->handle();
}
<?php

set_include_path(get_include_path() . PATH_SEPARATOR . 'ZendFramework-1.10.8/library/');
/* incluir as classes necessoarias */
include_once "ZendFramework-1.10.8/library/Zend/Soap/Server.php";
include_once "ZendFramework-1.10.8/library/Zend/Soap/AutoDiscover.php";
if (isset($_GET['wsdl'])) {
    /*          
     * Usar o Soap AutoDiscover para criacao do WSDL de forma dinamica          
     */
    $autodiscover = new Zend_Soap_AutoDiscover();
    $autodiscover->setClass('Calculadora');
    $autodiscover->handle();
} else {
    // Disponibilizar o webservice atraves do canal:
    $soap = new Zend_Soap_Server("http://127.0.0.1/calculadora_service/CalculadoraService.php?wsdl");
    $soap->setClass('Calculadora');
    $soap->handle();
}
/*
 * Classe calculadora
 */
class Calculadora
{
    /**
     * Realiza Soma
     * @param integer $a
     * @param integer $b
     * @return integer
     */
    public function soma($a, $b)
 public function channelAction()
 {
     $this->enforceSecurity();
     $params = Zend_Registry::get('params');
     if (isset($_GET['wsdl'])) {
         $autoDiscover = new Zend_Soap_AutoDiscover();
         $autoDiscover->setUri($params->homelet->domain . '/soap/channel');
         $autoDiscover->setClass('Service_Core_ChannelAccessor');
         $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/channel'));
         // set SOAP service class
         $server->setClass('Service_Core_ChannelAccessor');
         // handle request
         $server->handle();
     }
 }