public function soapServer($request, $response) {/*{{{*/ $postdata = file_get_contents("php://input"); $function = 'soapServer'; $this->ioLogRecorder->addLog(XDateTime::now()->toString()." service [{$function}] ".$this->ioLogRecorder->format2SimpleLog($postdata)); $configs = ProviderConfigFactory::getProviderAppConfigs(PhoneConference::SPTYPE_HUAWEI, TeleConfProvider::APPTYPE_CONF); $callbackUrl = $configs['callbackUrl']; $server = new SoapServer(null, array('uri' => 'HuaweiConfCallback','location'=>$callbackUrl)); $server->setClass('HuaweiTeleConfApi'); try { $lockName = $this->getLockerName($postdata); $cacher= DAL::get()->getCache(Cacher::CACHETYPE_LOCKER); $locker = LockUtil::factory(LockUtil::LOCK_TYPE_MEMCACHE, array('memcache' => $cacher)); $locker->getLock($lockName); $server->handle(); $locker->releaseLock($lockName); } catch(Exception $ex) { $locker->releaseLock($lockName); } header("HTTP/1.1 202 Accepted"); header("Content-Type: text/xml;charset=UTF-8"); return parent::DIRECT_OUTPUT; }/*}}}*/
public function callback() { $s = new SoapServer(DIR_CONFIG . 'ishopclientws.wsdl'); $s->setClass('qiwiSoap'); $s->handle(); exit; }
/** * Run webservice * * @param Mage_Api_Controller_Action $controller * @return Mage_Api_Model_Server_Adapter_Soap */ public function run() { $urlModel = Mage::getModel('core/url')->setUseSession(false); if ($this->getController()->getRequest()->getParam('wsdl') !== null) { // Generating wsdl content from template $io = new Varien_Io_File(); $io->open(array('path' => Mage::getModuleDir('etc', 'Mage_Api'))); $wsdlContent = $io->read('wsdl.xml'); $template = Mage::getModel('core/email_template_filter'); $wsdlConfig = new Varien_Object(); $queryParams = $this->getController()->getRequest()->getQuery(); if (isset($queryParams['wsdl'])) { unset($queryParams['wsdl']); } $wsdlConfig->setUrl(htmlspecialchars($urlModel->getUrl('*/*/*', array('_query' => $queryParams)))); $wsdlConfig->setName('Magento'); $wsdlConfig->setHandler($this->getHandler()); $template->setVariables(array('wsdl' => $wsdlConfig)); $this->getController()->getResponse()->setHeader('Content-Type', 'text/xml')->setBody($template->filter($wsdlContent)); } elseif ($this->_extensionLoaded()) { $this->_soap = new SoapServer($urlModel->getUrl('*/*/*', array('wsdl' => 1))); use_soap_error_handler(false); $this->_soap->setClass($this->getHandler()); $this->getController()->getResponse()->setHeader('Content-Type', 'text/xml')->setBody($this->_soap->handle()); } else { $this->fault('0', 'Unable to load Soap extension on the server'); } return $this; }
/** * Building query * * @param array $params Query params * @return array/boolean */ public function request() { $properties = array('classmap' => array('tns:updateBill' => 'qiwiParam', 'tns:updateBillResponse' => 'qiwiResponse')); $wsdl = MODX_CORE_PATH . 'components/minishop2/custom/payment/lib/qiwi/IShopClientWS.wsdl'; $Soap = new SoapServer($wsdl, $properties); $Soap->setClass('qiwiServer', $this->config['shopId'], $this->config['shopKey'], $this->config['statusPaid']); $Soap->handle(); return true; }
public function openinvoiceAction() { $_mode = $this->_getConfigData('demoMode'); $wsdl = $_mode == 'Y' ? 'https://ca-test.adyen.com/ca/services/OpenInvoiceDetail?wsdl' : 'https://ca-live.adyen.com/ca/services/OpenInvoiceDetail?wsdl'; $server = new SoapServer($wsdl); $server->setClass(self::OPENINVOICE_SOAP_SERVER); $server->addFunction(SOAP_FUNCTIONS_ALL); $server->handle(); exit; }
public function PanamericanaServer() { $server = new SoapServer("Oris.wsdl"); $server->setClass("Metodos"); try { $server->handle(); } catch (Exception $e) { $server->fault('Sender', $e->getMessage()); } }
public function ws() { Load::library('WebService'); $server = new SoapServer(null, array('uri' => 'http://localhost/freekore/test/ws')); // Asignamos la Clase $server->setClass('WebService'); // Atendemos las peticiones $server->handle(); $server->getFunctions(); }
/** * Add your definition route and the name route[optional] * * @Route /service * * * @param \Slim\Http\Request $request * @param \Slim\Http\Response $response * @param \Slim\Route $route */ public function indexAction($request, $response, $route) { $dirClass = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Soap' . DIRECTORY_SEPARATOR . 'wsdl' . DIRECTORY_SEPARATOR . 'service.wsdl'; if (file_exists($dirClass)) { $server = new \SoapServer($dirClass, array('soap_version' => SOAP_1_2)); $server->setClass('Raptor2\\ServiceBundle\\Soap\\Service'); $this->app->contentType(\Raptor\Raptor::APPXML); $server->handle(); } }
function index() { $wsdl = $this->getViewer('wsdl')->process($this); $wsdlFile = TEMP_FOLDER . '/sapphire-wsdl-' . $this->class; $fh = fopen($wsdlFile, 'w'); fwrite($fh, $wsdl); fclose($fh); $s = new SoapServer($wsdlFile, array('cache_wsdl' => WSDL_CACHE_NONE)); $s->setClass($this->class); $s->handle(); }
/** * handle 一个 SoapServer * * Uses: * <code> * Watt_Service_Servicer::handleSoapServer( "Your_Class_Servicer", "demo.wsdl" ); * </code> * * @param string $className * @param mixed $wsdl * @param array $options */ public static function handleSoapServer($className, $wsdl, array $options = array()) { if (!class_exists($className)) { Watt::loadClass($className); } //$server = new SoapServer( null, array('uri' => "http://test-uri/") ); $server = new SoapServer(Watt_Config::getConfigPath() . "wsdl/" . $wsdl); $server->setClass($className); $server->handle(); exit; }
public function index() { $host = $_SERVER['HTTP_HOST']; $module = MODULE_NAME; $action = ACTION_NAME; $server = ""; $wsdl = ""; $soaparray = array('soap_version' => SOAP_1_2); $server = new \SoapServer(file_get_contents(__DIR__ . '/ws/order.wsdl'), $soaparray); $server->setClass(get_class($this)); $server->handle(); }
public function order() { $host = $_SERVER['HTTP_HOST']; $module = MODULE_NAME; $action = ACTION_NAME; $server = ""; $wsdl = ""; $soaparray = array("uri" => "http://10.155.30.170:8880/ws/order.php?wsdl", 'soap_version' => SOAP_1_2); $soaparray = array("location" => "http://" . $host . "/" . $module . "/" . $action, "uri" => $action . ".html"); $server = new \SoapServer(null, $soaparray); $server->setClass(get_class($this)); $server->handle(); }
/** * Executa os métodos no ambiente de homologação do webservice SOAP */ public function homologacaoAction() { $this->noLayout(); ini_set('soap.wsdl_cache_enabled', '0'); $sWsdl = $this->view->baseUrl('/webservice/wsdlValidations/homologacao/modelo1.wsdl'); $server = new SoapServer($sWsdl, array('soap_version' => SOAP_1_1, 'uri' => $this->view->baseUrl('/webservice/index/homologacao/'), 'trace' => TRUE)); $server->setClass('WebService_Model_Processar'); $server->addFunction('RecepcionarLoteRps'); $server->addFunction('ConsultarSituacaoLoteRps'); $server->addFunction('ConsultarNfsePorRps'); $server->addFunction('ConsultarLoteRps'); $server->addFunction('CancelarNfse'); $server->addFunction('ConsultarNfse'); $server->handle(); }
/** * Finally returns a SoapClient instance. * * @return \BeSimple\SoapServer\SoapServer */ public function build() { $this->validateOptions(); use_soap_error_handler($this->errorReporting); $server = new SoapServer($this->wsdl, $this->getSoapOptions()); if (null !== $this->persistence) { $server->setPersistence($this->persistence); } if (null !== $this->handlerClass) { $server->setClass($this->handlerClass); } elseif (null !== $this->handlerObject) { $server->setObject($this->handlerObject); } return $server; }
/** * Execução de Serviço * * Construção de Serviços para determinados elementos do sistema, utilizando * ações nesta controladora para acesso. Esta inicialização deve ser * efetuada somente uma vez por requisição. * * @param string $element Nome do Serviço para Execução * @return null */ protected function _execute($element) { // Desabilitar Layout WSL_Controller_Front::getInstance()->getConfig()->setParam('Layout.enabled', false); // Inicialização $service = new SoapServer(null, array('uri' => 'tns:' . $element . 'Service')); // Configurar Classe $service->setClass('Service_' . $element); // Tratamento de Requisição try { $service->handle(); } catch (Exception $e) { // Tratamento de Erro $service->fault('Server', $e->getMessage()); } }
public function ws() { //error_log(__FILE__.__LINE__.":"."***** ws1"); error_reporting(E_ALL); include_once 'WebServices/system_available.cfg.php'; //Load the WSDL $soap = new SoapServer('./SOAP/ECservices.wsdl', array('encoding' => 'ISO-8859-1', "exceptions" => 1, "cache_wsdl" => WSDL_CACHE_NONE)); $soap->setClass('ServiceClass'); //error_log(__FILE__.__LINE__.":"."***** ws2"); //Handle the request try { $soap->handle(); } catch (SoapFault $fault) { error_log(__FILE__ . __LINE__ . ":" . print_r($fault, true)); } //echo "a"; unset($soap); //error_log(__FILE__.__LINE__.":"."***** ws3"); }
public function panamericana($wsdl = false) { if (!$wsdl) { $this->loadController('metodosController'); $server = new SoapServer(ROOT . 'public' . DS . 'panamericana.wsdl'); $server->setClass('metodosController'); /* $tz = date_default_timezone_get(); $header = new SoapHeader('urn:pc_SOAP_return_time', 'get_timezone', $tz); $server->addSoapHeader($header); */ try { $server->handle(); } catch (Exception $e) { $server->fault('Sender', $e->getMessage()); } } else { $this->_view->renderizaWSDL('panamericana'); } }
throw new SoapFault("Sender", "INVALID_INPUT"); } /* Error Handling */ // verify tax ID if (!$obj_tax->verify_id()) { throw new SoapFault("Sender", "INVALID_ID"); } // check that the tax can be safely deleted if ($obj_tax->check_delete_lock()) { throw new SoapFault("Sender", "LOCKED"); } /* Perform Changes */ if ($obj_tax->action_delete()) { return 1; } else { throw new SoapFault("Sender", "UNEXPECTED_ACTION_ERROR"); } } else { throw new SoapFault("Sender", "ACCESS DENIED"); } } } // end of taxes_manage_soap class // define server $server = new SoapServer("taxes_manage.wsdl"); $server->setClass("accounts_taxes_manage_soap"); $server->handle();
<?php /* Copyright (c) 2010 Kalle Räisänen. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ require_once 'service.php'; if (isset($_GET['class']) && in_array($_GET['class'], $SOAPCLASSES)) { $class = basename($_GET['class']); # Inkludera filen i vilken $class definieras: require_once $class . '.php'; # Skapa ny SoapServer $server = new SoapServer(TLON_WSDL . $class); $server->setClass($class); $server->handle(); }
/** * Catches index.php/wpws requests, stops further execution by WordPress * and handles the request depending on the request type. * * The are 3 types of treatment: * 1) User hasn't requested a WSDL file nor a SOAP operation => HTML output of general information * 2) User has requested requested WSDL file => deliveration by SoapServer instance * 3) User has submited a SOAP operation request => treatment by SoapServer instance * * Because the caller needs to know where he can access the service * the correct blog address needs to be specified in the service port of the WSDL. * For that reason only a template WSDL file exists. Should the script detect that * a customized WSDL with the correct address doesn't exist it creates it * by making a copy of the template WSDL and by replacing the address placeholder. * Should you ever need to reallocate the Blog simply delete the wpws.wsdl but provoke it's recreation. */ function wpws_handle_request($wp) { // Look for the magic /wpws string in the $_SERVER variable $wpws_found = false; $wsdl_requested = false; unset($_SERVER['argv']); foreach ($_SERVER as $val) { if (strlen($val) >= 5 && substr($val, 0, 5) == "/wpws") { $wpws_found = true; if (isset($_SERVER["QUERY_STRING"]) && strpos($_SERVER["QUERY_STRING"], "?wsdl") !== false) { $wsdl_requested = true; } break; } } if ($wpws_found) { // make sure the QUERY_STRING is correctly set to ?wsdl so the SoapServer instance delivers the wsdl file if ($wsdl_requested) { header("Content-type: text/xml"); echo wpws_getWSDLfromTemplate(); exit; } else { if (!isset($_SERVER["HTTP_SOAPACTION"])) { // client hasn't requested a SOAP operation // return HTML page include WPWS_INDEX_FILE; } else { // Create a customized WSDL file on disk // so the SoapServer can take this copy to load from. wpws_createWSDL(); // SoapServer handles both: deliveration of the requested WSDL file // and execution of SOAP operations header("Content-type: text/xml"); require_once WPWS_SOAP_SERVER_FILE; ini_set("soap.wsdl_cache_enabled", "0"); $server = new SoapServer(WPWS_WSDL, array("cache_wsdl" => WSDL_CACHE_NONE)); $server->setClass(WPWS_SOAP_SERVER_CLASS); $server->handle(); } } exit; } // no wpws-request, go on with WordPress execution }
<?php $soap = new SoapServer('RandomNumberService.wsdl', array('uri' => 'http://javascript.phrasebook.org/')); $soap->setClass('ServiceClass'); $soap->handle(); class ServiceClass { function randomNumber($lower, $upper) { return rand($lower, $upper); } }
<?php class HelloWorld { function hello($name) { return "Hello from " . $name; } } $URL = "http://localhost/github/PGROU/testsCedric/testWS/test.wsdl"; $server = new SoapServer($URL); $server->setClass("HelloWorld"); if ($_SERVER["REQUEST_METHOD"] == "POST") { $server->handle(); } else { echo "Ce serveur SOAP peut gérer les fonctions suivantes : "; $functions = $server->getFunctions(); foreach ($functions as $func) { echo $func . "\r"; } }
<?php include_once "web/prepend.php"; include_once "assessor/Land.php"; include_once "assessor/LandRecords.php"; //* $server = new SoapServer("urn:Object"); $server->setClass('LandDetails'); $server->handle(); //*/ class LandDetails { var $land; function LandDetails() { $this->land = new Land(); } function getLand($propertyID) { $land = new Land(); $land->selectRecord($propertyID); if (!($domDoc = $land->getDomDocument())) { return false; } else { $xmlStr = $domDoc->dump_mem(true); return $xmlStr; } } } /* $LandDetails = new LandDetails;
public function startServer($className) { $server = new SoapServer(NULL, array('uri' => "http://" . $_SERVER["HTTP_HOST"] . "/")); $server->setClass($className); $server->handle(); }
<?php include "library.php"; //$cal = new Calculator(); //echo $cal->sum(20,10); $options = array('location' => 'http://localhost/test/web-service/server/service.php', 'uri' => 'http://localhost'); $soapServer = new SoapServer(null, $options); //$soapServer = new SoapServer("http://localhost/test/web-service/server/create.php"); //$soapServer = new SoapServer("./server.wsdl"); $soapServer->setClass('Calculator'); $soapServer->handle();
<?php class API { function helloworld() { return "Hello World!"; } function addition($a, $b) { return $a + $b; } function getData() { mysql_connect('localhost', 'root', ''); mysql_select_db('wordpress'); $result = mysql_query('SELECT * FROM wp_users'); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { foreach ($row as $column) { $var = $column; } } return $var; } } $opt = array('uri' => 'http://localhost'); $server = new SoapServer(NULL, $opt); $server->setClass('API'); $server->handle();
<?php use WSDL\WSDLCreator; require_once '../../vendor/autoload.php'; ini_set("soap.wsdl_cache_enabled", 0); $wsdl = new WSDLCreator('SimpleSoapServer', 'http://localhost/wsdl-creator/examples/rpc_literal/SimpleExampleSoapServer.php'); $wsdl->setNamespace("http://foo.bar/"); if (isset($_GET['wsdl'])) { $wsdl->renderWSDL(); exit; } $wsdl->renderWSDLService(); $server = new SoapServer('http://localhost/wsdl-creator/examples/rpc_literal/SimpleExampleSoapServer.php?wsdl', array('uri' => $wsdl->getNamespaceWithSanitizedClass(), 'location' => $wsdl->getLocation(), 'style' => SOAP_RPC, 'use' => SOAP_LITERAL)); $server->setClass('SimpleSoapServer'); $server->handle(); class SimpleSoapServer { /** * @WebMethod * @param string $name * @param int $age * @return string $nameWithAge */ public function getNameWithAge($name, $age) { return 'Your name is: ' . $name . ' and you have ' . $age . ' years old'; } /** * @WebMethod * @param string[] $names * @return string $userNames
<?php # Setup PHPLIB in this Area include_once "web/prepend.php"; include_once "assessor/Owner.php"; include_once "assessor/Assessor.php"; include_once "assessor/TD.php"; include_once "assessor/AFS.php"; //* $server = new SoapServer("urn:Object"); $server->setClass('TDEncode'); $server->handle(); //*/ class TDEncode { function TDEncode() { } function saveTDForBuildup($xmlStr) { if (!($domDoc = domxml_open_mem($xmlStr))) { return false; } $td = new TD(); $td->parseDomDocument($domDoc); $ret = $td->insertRecordForBuildup(); return $ret; } function saveTD($xmlStr) { if (!($domDoc = domxml_open_mem($xmlStr))) {
* * 2007 - 2016, Rainer Furtmeier - Rainer@Furtmeier.IT */ require "../system/connect.php"; class AppProvider { function test() { return "Test erfolgreich"; } /*private function login($credentials){ $U = new Users(); $L = $U->getUser($credentials->username, $credentials->SHAPassword, true); if($L === null) throw new SoapFault("Server", "Credentials invalid"); return $L; }*/ function getApplications() { return Applications::getList(); } function getServices() { return Services::getList(); } } $S = new SoapServer(null, array('uri' => 'http://localhost/' . $_SERVER["SCRIPT_NAME"])); $S->setClass('AppProvider'); $S->handle();
function showIndex() { ini_set("soap.wsdl_cache_enabled", "0"); $server = new SoapServer(fvSite::$fvConfig->get('path.wsdl')); $server->setClass($this->moduleName . 'Action'); $server->handle(); }