SoapServer::addFunction

(PHP 5, PHP 7, PHP 8)

SoapServer::addFunctionAdds one or more functions to handle SOAP requests

Açıklama

public SoapServer::addFunction(array|string|int $functions): void

Exports one or more functions for remote clients

Bağımsız Değişkenler

functions

To export one function, pass the function name into this parameter as a string.

To export several functions, pass an array of function names.

To export all the functions, pass a special constant SOAP_FUNCTIONS_ALL.

Bilginize:

functions must receive all input arguments in the same order as defined in the WSDL file (They should not receive any output parameters as arguments) and return one or more values. To return several values they must return an array with named output parameters.

Dönen Değerler

Hiçbir değer dönmez.

Örnekler

Örnek 1 SoapServer::addFunction() example

<?php

function echoString($inputString)
{
return
$inputString;
}

$server->addFunction("echoString");

function
echoTwoStrings($inputString1, $inputString2)
{
return array(
"outputString1" => $inputString1,
"outputString2" => $inputString2);
}
$server->addFunction(array("echoString", "echoTwoStrings"));

$server->addFunction(SOAP_FUNCTIONS_ALL);

?>

Ayrıca Bakınız

add a note

User Contributed Notes 1 note

up
11
dotpointer at gmail dot com
16 years ago
Be careful with SOAP_FUNCTIONS_ALL, as it adds ALL availiable PHP functions to your server.

This can be a potential security threat, imagine clients doing this:

echo $client->file_get_contents("c:\\my files\\my_passwords.doc");

And voila, they have the contents of your file my_passwords.doc.
To Top