mirror of
https://github.com/php/doc-pt_br.git
synced 2026-04-23 16:18:19 +02:00
151 lines
4.2 KiB
XML
151 lines
4.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 577239f64b3959c22d348a5f381eaf32fde996ed Maintainer: leonardolara Status: ready --><!-- CREDITS: fernandowobeto, leonardolara -->
|
|
<refentry xml:id="soapserver.addfunction" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>SoapServer::addFunction</refname>
|
|
<refpurpose>Adiciona uma ou mais funções para lidar com solicitações SOAP</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis role="SoapServer">
|
|
<modifier>public</modifier> <type>void</type><methodname>SoapServer::addFunction</methodname>
|
|
<methodparam><type class="union"><type>array</type><type>string</type><type>int</type></type><parameter>functions</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Exporta uma ou mais funções para clientes remotos
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>functions</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Para exportar uma função, passe o nome da função para este parâmetro como
|
|
uma string.
|
|
</para>
|
|
<para>
|
|
Para exportar diversas funções, passe um array de nomes de funções.
|
|
</para>
|
|
<para>
|
|
Para exportar todas as funções, passe um array com o nome de todas as funções.
|
|
</para>
|
|
<simpara>
|
|
A partir do PHP 8.4.0, passar um valor <type>int</type> (incluindo
|
|
<constant>SOAP_FUNCTIONS_ALL</constant>) foi descontinuado.
|
|
Use <function>get_defined_functions</function> para obter os nomes de todas as funções
|
|
e passá-los como um array.
|
|
</simpara>
|
|
<note>
|
|
<para>
|
|
<parameter>functions</parameter> devem receber todos os argumentos de entrada na mesma
|
|
ordem definida no arquivo WSDL (eles não devem receber nenhum parâmetro de saída
|
|
como argumentos) e retornar um ou mais valores. Para retornar vários valores eles devem
|
|
retornar um array com parâmetros de saída nomeados.
|
|
</para>
|
|
</note>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.void;
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.4.0</entry>
|
|
<entry>
|
|
Passar um <type>int</type> para
|
|
<methodname>SoapServer::addFunction</methodname>,
|
|
incluindo <constant>SOAP_FUNCTIONS_ALL</constant>, foi descontinuado.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemplo de <function>SoapServer::addFunction</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
function echoString($inputString)
|
|
{
|
|
return $inputString;
|
|
}
|
|
|
|
$server->addFunction("echoString");
|
|
|
|
function echoTwoStrings($inputString1, $inputString2)
|
|
{
|
|
return array("outputString1" => $inputString1,
|
|
"outputString2" => $inputString2);
|
|
}
|
|
$server->addFunction(array("echoString", "echoTwoStrings"));
|
|
|
|
$functions = array_merge(...get_defined_functions());
|
|
$server->addFunction($functions);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><methodname>SoapServer::__construct</methodname></member>
|
|
<member><methodname>SoapServer::setClass</methodname></member>
|
|
</simplelist>
|
|
</para>
|
|
</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:"~/.phpdoc/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
|
|
-->
|