本文整理汇总了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;
}
示例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();
}
示例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();
}
示例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());
}
}
示例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
示例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();
示例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();
示例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();
示例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;
}
示例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");
示例11: Demo
<?php
function Demo($param1)
{
return 'Request received with param1 = ' . $param1;
}
$server = new SoapServer('demo.wsdl');
$server->addFunction('Demo');
$server->handle();
示例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) {
示例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();
示例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();
示例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";