当前位置: 首页>>代码示例>>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;未经允许,请勿转载。