當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SoapServer::addFunction方法代碼示例

本文整理匯總了PHP中SoapServer::addFunction方法的典型用法代碼示例。如果您正苦於以下問題:PHP SoapServer::addFunction方法的具體用法?PHP SoapServer::addFunction怎麽用?PHP SoapServer::addFunction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SoapServer的用法示例。


在下文中一共展示了SoapServer::addFunction方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: openinvoiceAction

 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;
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:10,代碼來源:ProcessController.php

示例2: soap_serve

function soap_serve($wsdl, $functions)
{
    // create server object
    $s = new SoapServer($wsdl);
    // export functions
    foreach ($functions as $func) {
        $s->addFunction($func);
    }
    // handle the request
    $s->handle();
}
開發者ID:JackCanada,項目名稱:moodle-hacks,代碼行數:11,代碼來源:phpsoap.php

示例3: homologacaoAction

 /**
  * 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();
 }
開發者ID:arendasistemasintegrados,項目名稱:mateusleme,代碼行數:18,代碼來源:IndexController.php

示例4: handle

 public function handle()
 {
     $result = $this->generateSoapXML($this->data);
     $result = new SimpleXMLElement($result);
     if ($this->wsdl_out == true) {
         //header("Content-Type: application/xml; charset=utf-8");
         //echo $result->asXml();
         $tmpfile = tempnam(sys_get_temp_dir(), "wsdl");
         $file = fopen($tmpfile, "w");
         fwrite($file, $result->asXml());
         fclose($file);
         $server = new SoapServer($tmpfile);
         foreach ($this->data as $value) {
             $server->addFunction($value->funcName);
         }
         $server->handle();
         unlink($tmpfile);
         return;
     } else {
         echo $this->echoXML($result->asXml());
     }
 }
開發者ID:karimhouty,項目名稱:ProjetWSLocation,代碼行數:22,代碼來源:wsdl.class.php

示例5: sendNotification

 * 
 * @link	3.Notifications/soap/notification_server.php 
 * @author	Created by Adyen - Payments Made Easy
 */
/**
 * Create a SoapServer which implements the SOAP protocol used by Adyen and 
 * implement the sendNotification action in order to call a function handling
 * the notification.
 * 
 * new SoapServer($wsdl,$options)
 * - $wsdl points to the wsdl you are using;
 * - $options[cache_wsdl] = WSDL_CACHE_BOTH, we advice 
 *   to cache the WSDL since we usually never change it.
 */
$server = new SoapServer("https://ca-test.adyen.com/ca/services/Notification?wsdl", array("style" => SOAP_DOCUMENT, "encoding" => SOAP_LITERAL, "cache_wsdl" => WSDL_CACHE_BOTH, "trace" => 1));
$server->addFunction("sendNotification");
$server->handle();
function sendNotification($request)
{
    /**
     * In SOAP it's possible that we send you multiple notifications
     * in one request. First we verify if the request the SOAP envelopes.
     */
    if (isset($request->notification->notificationItems) && count($request->notification->notificationItems) > 0) {
        foreach ($request->notification->notificationItems as $notificationRequestItem) {
            /**
             * Each $notificationRequestItem contains the following fields:
             * $notificationRequestItem->amount->currency
             * $notificationRequestItem->amount->value
             * $notificationRequestItem->eventCode
             * $notificationRequestItem->eventDate
開發者ID:accunite,項目名稱:php,代碼行數:31,代碼來源:notification-server.php

示例6: deleteDirectory

        deleteDirectory($tempPath);
        deleteDirectory($tempPathNewFiles);
        return serialize($data);
    } else {
        deleteDirectory($tempPath);
        deleteDirectory($tempPathNewFiles);
        return false;
    }
}
/**
 * @param $directoryPath
 * @return bool
 */
function deleteDirectory($directoryPath)
{
    $files = array_diff(scandir($directoryPath), array('.', '..'));
    foreach ($files as $file) {
        if (is_dir("{$directoryPath}/{$file}")) {
            deleteDirectory("{$directoryPath}/{$file}");
        } else {
            unlink("{$directoryPath}/{$file}");
        }
    }
    return rmdir($directoryPath);
}
$webPath = api_get_path(WEB_PATH);
$webCodePath = api_get_path(WEB_CODE_PATH);
$options = array('uri' => $webPath, 'location' => $webCodePath . 'webservices/additional_webservices.php');
$soapServer = new SoapServer(NULL, $options);
$soapServer->addFunction('wsConvertPpt');
$soapServer->handle();
開發者ID:KRCM13,項目名稱:chamilo-lms,代碼行數:31,代碼來源:additional_webservices.php

示例7: SoapServer

    if (!isset($Encoding)) {
        $A->Encoding = 2;
    } else {
        $A->Encoding = $Encoding;
    }
    $xml_result = $A->DoXML();
    if ($A->IsError == 1) {
        return -1;
    }
    return $xml_result;
}
/*$login_password = new LogPass;
$login_password->login = "test1";
$login_password->password = "test";

print_r(authorize($login_password));*/
ini_set("soap.wsdl_cache_enabled", "0");
// отключаем кэширование WSDL
$server = new SoapServer("gateway_ver3.xml", array('encoding' => 'UTF-8'));
$server->addFunction("get_user_by_phone");
$server->addFunction("get_name_by_phone");
$server->addFunction("get_statistic");
$server->addFunction("save_call");
$server->addFunction("authorize");
$server->addFunction("keep_alive");
$server->addFunction("session_kill");
$server->addFunction("get_pause_statuses");
$server->addFunction("get_pause_curent_status");
$server->addFunction("set_pause_curent_status");
$server->addFunction("get_queue_stat");
$server->handle();
開發者ID:kipkaev55,項目名稱:asterisk,代碼行數:31,代碼來源:gateway_ver3.php

示例8: getStock

<?php

// Описание функции Web-сервиса
function getStock($id)
{
    $stock = array("1" => 100, "2" => 200, "3" => 300, "4" => 400, "5" => 500);
    if (isset($stock[$id])) {
        $quantity = $stock[$id];
        return $quantity;
    } else {
        throw new SoapFault("Server", "Несуществующий id товара");
    }
}
// Отключение кэширования WSDL-документа
ini_set("soap.wsdl_cache_enabled", "0");
// Создание SOAP-сервер
$server = new SoapServer("http://mysite.local/demo/soap/stock.wsdl");
// Добавить класс к серверу
$server->addFunction("getStock");
// Запуск сервера
$server->handle();
開發者ID:BulatSa,項目名稱:php-3,代碼行數:21,代碼來源:server.php

示例9: _getSoap

 /**
  * Get SoapServer object
  *
  * Uses {@link $_wsdl} and return value of {@link getOptions()} to instantiate
  * SoapServer object, and then registers any functions or class with it, as
  * well as peristence.
  *
  * @return SoapServer
  */
 protected function _getSoap()
 {
     $options = $this->getOptions();
     $server = new SoapServer($this->_wsdl, $options);
     if (!empty($this->_functions)) {
         $server->addFunction($this->_functions);
     }
     if (!empty($this->_class)) {
         $args = $this->_classArgs;
         array_unshift($args, $this->_class);
         if ($this->_wsiCompliant) {
             #require_once 'Zend/Soap/Server/Proxy.php';
             array_unshift($args, 'Zend_Soap_Server_Proxy');
         }
         call_user_func_array(array($server, 'setClass'), $args);
     }
     if (!empty($this->_object)) {
         $server->setObject($this->_object);
     }
     if (null !== $this->_persistence) {
         $server->setPersistence($this->_persistence);
     }
     return $server;
 }
開發者ID:lightyoruichi,項目名稱:Magento-Pre-Patched-Files,代碼行數:33,代碼來源:Server.php

示例10: wsResponse

    if ($vsResult->status_code !== 0) {
        return $vsResult;
    }
    if (ifPermission($params->sessionId, 'PM_CASES') == 0) {
        $result = new wsResponse(2, G::LoadTranslation('ID_NOT_PRIVILEGES'));
        return $result;
    }
    G::LoadClass('sessions');
    $oSessions = new Sessions();
    $session = $oSessions->getSessionUser($params->sessionId);
    $ws = new wsBase();
    $res = $ws->claimCase($session['USR_UID'], $params->guid, $params->delIndex);
    return $res;
}
$server = new SoapServer($wsdl);
$server->addFunction("Login");
$server->addFunction("ProcessList");
$server->addFunction("CaseList");
$server->addFunction("UnassignedCaseList");
$server->addFunction("RoleList");
$server->addFunction("GroupList");
$server->addFunction("DepartmentList");
$server->addFunction("UserList");
$server->addFunction("TriggerList");
$server->addFunction("outputDocumentList");
$server->addFunction("inputDocumentList");
$server->addFunction("inputDocumentProcessList");
$server->addFunction("removeDocument");
$server->addFunction("SendMessage");
$server->addFunction("SendVariables");
$server->addFunction("GetVariables");
開發者ID:bqevin,項目名稱:processmaker,代碼行數:31,代碼來源:soap2.php

示例11: Demo

<?php

function Demo($param1)
{
    return 'Request received with param1 = ' . $param1;
}
$server = new SoapServer('demo.wsdl');
$server->addFunction('Demo');
$server->handle();
開發者ID:ZSShang,項目名稱:mylearn,代碼行數:9,代碼來源:service.php

示例12: array

     * Can't even say, which certificates, however it says in the docu that this should be a .pem RSA encoded file with .key and .crt together.
     *
     */
    $context = array('ssl' => array('verify_peer' => false, 'allow_self_signed' => true, 'local_cert' => $sslCert, 'passphrase' => 'hisuser', 'capture_peer_cert' => true));
    $stream_context = stream_context_create($context);
    $server = new SoapServer($wsdl, array('soap_version' => SOAP_1_1, 'stream_context' => $stream_context));
} else {
    $server = new SoapServer($wsdl, array('soap_version' => SOAP_1_1));
}
/**
 * adds the functions to the SoapServer Object,
 *
 * the sChangeSurvey function should be commented out for productive Use
 */
//$server->addFunction("sChangeSurvey");
$server->addFunction("sDeleteSurvey");
$server->addFunction("sActivateSurvey");
$server->addFunction("sCreateSurvey");
$server->addFunction("sInsertToken");
$server->addFunction("sTokenReturn");
$server->addFunction("sInsertParticipants");
$server->addFunction("sImportGroup");
$server->addFunction("sAvailableModules");
$server->addFunction("sImportQuestion");
$server->addFunction("sImportMatrix");
$server->addFunction("sImportFreetext");
$server->addFunction("sSendEmail");
$server->addFunction("sGetFieldmap");
$server->addFunction("fSendStatistic");
// handle the soap request!
if ($enableLsrc === true) {
開發者ID:himanshu12k,項目名稱:ce-www,代碼行數:31,代碼來源:lsrc.server.php

示例13: chr

        return '1' . chr(9) . $svar;
    }
    $linje = "update ordrelinjer set leveret = antal,leveres='0' where ordre_id = '{$ordre_id}' and vare_id>'0'";
    fwrite($fp, $linje . "\n");
    $svar = db_modify($linje, __FILE__ . " linje " . __LINE__);
    $linje = "bogfor({$ordre_id},'on')";
    fwrite($fp, $linje . "\n");
    $svar = bogfor($ordre_id, 'on');
    list($fejl, $svar) = explode(chr(9), $svar);
    fwrite($fp, $fejl . " " . $svar . "\n");
    if ($fejl != 'OK') {
        $linje = "{$fejl}";
        #		fwrite($fp,$linje."\n");
        return '1' . chr(9) . $fejl;
    } else {
        transaktion('commit');
    }
    $linje = "formularprint({$ordre_id},'4','1',{$charset},'email')";
    fwrite($fp, $linje . "\n");
    $svar = formularprint($ordre_id, '4', '1', $charset, 'email');
    fwrite($fp, $linje . "Svar " . $svar . "\n");
    if ($svar && $svar != 'OK') {
        return '1' . chr(9) . $svar;
    } else {
        fclose($fp);
        return '0' . chr(9) . $ordre_id;
    }
}
$server = new SoapServer("invoice.wsdl");
$server->addFunction("invoice");
$server->handle();
開發者ID:nielsrune,項目名稱:saldi_ce,代碼行數:31,代碼來源:invoice.php

示例14: array

    $res = 1;
    if ($res !== 1) {
        $ret->status = 9;
        $ret->Message = "パスワード変更に失敗しました。";
        return $ret;
    }
    $ret->status = 0;
    return $ret;
}
/*
$ary = array();
$ary['staffcode'] = '01234567';
$ary['password'] = '1yYSQrUh';

$ret = Authenticate($ary);
var_dump($ret);
exit;
*/
/**
 * SOAPサーバオブジェクトの作成
 */
$server = new SoapServer(null, array('uri' => 'http://10.1.2.17/soap/'));
//$server = new SoapServer(null, array('uri' => 'http://10.1.2.16/soap/'));
/**
 * サービスの追加
 */
$server->addFunction(array("Authenticate", "ChangePassword"));
/**
 * サービスを実行
 */
$server->handle();
開發者ID:honda-kyoto,項目名稱:UMS-Kyoto,代碼行數:31,代碼來源:SoapServer_Portal2.php

示例15: test

    public $var1;
}
class CT_A2 extends CT_A1
{
    public $var2;
}
class CT_A3 extends CT_A2
{
    public $var3;
}
// returns A2 in WSDL
function test($a1)
{
    $a3 = new CT_A3();
    $a3->var1 = $a1->var1;
    $a3->var2 = "var two";
    $a3->var3 = "var three";
    return $a3;
}
$classMap = array("A1" => "CT_A1", "A2" => "CT_A2", "A3" => "CT_A3");
$client = new SoapClient(dirname(__FILE__) . "/bug36575.wsdl", array("trace" => 1, "exceptions" => 0, "classmap" => $classMap));
$a2 = new CT_A2();
$a2->var1 = "one";
$a2->var2 = "two";
$client->test($a2);
$soapRequest = $client->__getLastRequest();
echo $soapRequest;
$server = new SoapServer(dirname(__FILE__) . "/bug36575.wsdl", array("classmap" => $classMap));
$server->addFunction("test");
$server->handle($soapRequest);
echo "ok\n";
開發者ID:badlamer,項目名稱:hhvm,代碼行數:31,代碼來源:bug36575.php


注:本文中的SoapServer::addFunction方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。