0

我有一个必须跨服务器工作的 PHP 函数类。所以我已经搜索并决定尝试没有 WSDL 的 SOAP,它就像一个魅力。但是当一页中有超过 5-6 个函数调用 ($soap->function()) 时,它生成的结果真的很慢。那么我怎样才能像一个被调用的 CLASS 一样运行那个 SOAP 代码并让所有函数都静态。有办法吗?或者我应该使用什么来代替 SOAP?

调用.php

$options = array(
    "uri" => "https://globalurl",
    "location" => "https://globalurl/soapserver.php",
);
$soap = new SoapClient(null, $options);
$header = new SoapHeader('https://globalurl', 'soapAuth', 'AUTHCODE.KEY', false, SOAP_ACTOR_NEXT);
$soap->__setSoapHeaders($header);

print_r($soap->hashFunction('XXX'));
print_r($soap->siteFunction('XXX'));
print_r($soap->encryptFunction('XXX', '', 2));
print_r($soap->decryptFunction('XXX','', 2));
print_r($soap->remoteIPFunction());

肥皂服务器.php

class soapGlobal {

    public function __construct() {
    }
    public static function hashFunction() {
        //some function...
    }
    public static function siteFunction() {
        //some function...
    }
    public static function encryptFunction() {
        //some function...
    }
    public static function decryptFunction() {
        //some function...
    }
    public static function remoteIPFunction() {
        //some function...
    }

//some more function...

}

$server = new SoapServer(null, array("uri" => "https://globalurl"));
$server->setClass("soapGlobal");
$server->handle();

我需要我的代码来调用一个跨服务器函数类并使用它,但没有所有的延迟时间。先感谢您...

4

0 回答 0