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


PHP SoapServer::AddFunction方法代碼示例

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


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

示例1: gjAreLocal

 * Provides a simple SOAP server for demo purposes
 *
 */
require_once '../includes/gj_utility.inc.php';
require_once '../includes/gj_soap.inc.php';
require 'service_functions.php';
global $gjDebug;
global $gjXDebug;
global $gjLocal;
$gjLocal = gjAreLocal();
$gjDebug = true;
//for both set, do not comment out
$gjXDebug = false;
$server = new SoapServer("simpleO.wsdl");
$server->setClass('MyAPI', 'arg1 maybe a cert');
$server->AddFunction("getHello");
$server->AddFunction("getGoodbye");
$server->handle();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $server->handle();
} else {
    echo "This SOAP server can handle following functions:<br>";
    $functions = $server->getFunctions();
    foreach ($functions as $func) {
        echo $func . "<br>";
    }
}
?>


開發者ID:gmgj,項目名稱:gjsoap,代碼行數:28,代碼來源:simpleserver.php

示例2: doHello

<?php

if (!extension_loaded("soap")) {
    dl("php_soap.dll");
}
ini_set("soap.wsdl_cache_enabled", "0");
$server = new SoapServer("wsdl.php");
function doHello($yourName)
{
    return "Hello, " . $yourName;
}
$server->AddFunction("doHello");
$server->handle();
開發者ID:aidoskz,項目名稱:Storage,代碼行數:13,代碼來源:index.php

示例3: RegistrarSuce

<?php

include_once 'conexion/DBManager.php';
include_once "clases/cFormato.php";
if (!extension_loaded("soap")) {
    dl("php_soap.dll");
}
ini_set("soap.wsdl_cache_enabled", "0");
$server = new SoapServer("services/ServicioEntidad.wsdl");
function RegistrarSuce($params)
{
    $db = new ConSQL();
    $db->connect();
    $objFormato = new cFormato();
    $objFormato->llenar($params);
    $db->beginTransacction();
    $res = $objFormato->insertar($db);
    if ($res != null) {
        $db->commit();
        $msj = array("codigo" => "OK", "texto" => "Exito");
    } else {
        error_log("Entidad.WebServices ServicioEntidad->RegistrarSuce failed");
        $db->rollback();
        $msj = array("codigo" => "ERROR", "texto" => "No se pudo insertar: ");
    }
    return $msj;
}
//  mysqli_close($con);
$server->AddFunction("RegistrarSuce");
$server->handle();
$server->addFunction(SOAP_FUNCTIONS_ALL);
開發者ID:alexcarlosramirez,項目名稱:upcdsd-viii-vuce,代碼行數:31,代碼來源:ServicioEntidad.php


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