2004-02-24 14:31:49 +00:00
|
|
|
<?xml version='1.0' encoding='iso-8859-1'?>
|
2004-02-27 16:36:36 +00:00
|
|
|
<!-- $Revision: 1.4 $ -->
|
2004-02-24 14:31:49 +00:00
|
|
|
<refentry id="function.SoapServer-addFunction">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>SoapServer::addFunction</refname>
|
|
|
|
<refpurpose>
|
|
|
|
Adds one or several functions those will handle SOAP requests
|
|
|
|
</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<methodsynopsis>
|
|
|
|
<type>void</type><methodname>SoapServer::addFunction</methodname>
|
|
|
|
<methodparam><type>mixed</type><parameter>functions</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
|
|
Exports one or more functions for remote clients.
|
|
|
|
</para>
|
|
|
|
<para>
|
2004-02-27 13:59:44 +00:00
|
|
|
To export one function, pass the function name into the
|
|
|
|
<parameter>functions</parameter> parameter as a string.
|
|
|
|
To export several functions pass an array of function names, and to export all
|
2004-02-24 14:31:49 +00:00
|
|
|
functions pass a special constant <constant>SOAP_FUNCTIONS_ALL</constant>.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<parameter>functions</parameter> 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
|
2004-02-27 13:59:44 +00:00
|
|
|
return an array with named output parameters.
|
2004-02-24 14:31:49 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title>Some examples</title>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
|
2004-02-27 12:27:53 +00:00
|
|
|
function echoString($inputString)
|
2004-02-24 14:31:49 +00:00
|
|
|
{
|
|
|
|
return $inputString;
|
|
|
|
}
|
2004-02-27 12:27:53 +00:00
|
|
|
|
2004-02-24 14:31:49 +00:00
|
|
|
$server->addFunction("echoString");
|
|
|
|
|
|
|
|
function echoTwoStrings($inputString1, $inputString2)
|
|
|
|
{
|
|
|
|
return array("outputString1" => $inputString1,
|
|
|
|
"outputString2" => $inputString2);
|
|
|
|
}
|
|
|
|
$server->addFunction(array("echoString", "echoTwoStrings"));
|
|
|
|
|
|
|
|
$server->addFunction(SOAP_FUNCTIONS_ALL);
|
|
|
|
|
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
2004-02-27 16:36:36 +00:00
|
|
|
<para>
|
|
|
|
See also
|
|
|
|
<function>SoapServer::SoapServer</function>, and
|
|
|
|
<function>SoapServer::SetClass</function>.
|
|
|
|
</para>
|
2004-02-24 14:31:49 +00:00
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|