1
0
mirror of https://github.com/php/doc-ru.git synced 2026-03-23 23:32:16 +01:00
Files
archived-doc-ru/reference/xmlrpc/functions/xmlrpc-encode-request.xml
Mikhail Alferov 880e6f88f2 Update 3abd17e to En (#1093)
* Update http.xml to en

* Update file-get-contents.xml to en

* Update libxml-set-streams-context.xml to en

* Update stream-context-get-default.xml to en

* Update stream-context-set-default.xml to en

* Update xmlrpc-encode-request.xml to en
2025-07-25 16:28:46 +03:00

135 lines
4.2 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 3abd17e61d5022d503604cc06894254e3281acf5 Maintainer: mch Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.xmlrpc-encode-request" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>xmlrpc_encode_request</refname>
<refpurpose>Генерирует XML-запрос для вызова удалённого метода</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>xmlrpc_encode_request</methodname>
<methodparam><type>string</type><parameter>method</parameter></methodparam>
<methodparam><type>mixed</type><parameter>params</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>output_options</parameter></methodparam>
</methodsynopsis>
&warn.experimental.func;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>method</parameter></term>
<listitem>
<para>
Название метода для вызова.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>params</parameter></term>
<listitem>
<para>
Параметры метода, совместимые с сигнатурой вызова.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>output_options</parameter></term>
<listitem>
<para>
Массив для определения параметров вывода. Значения по умолчанию выделены курсивом:
<itemizedlist>
<listitem><para>output_type: php, <emphasis>xml</emphasis></para></listitem>
<listitem><para>verbosity: no_white_space, newlines_only, <emphasis>pretty</emphasis></para></listitem>
<listitem><para>escaping: cdata, <emphasis>non-ascii, non-print, markup</emphasis> — строка с единственным значением или массив значений</para></listitem>
<listitem><para>version: simple, <emphasis>xmlrpc</emphasis>, soap 1.1, auto</para></listitem>
<listitem><para>encoding: <emphasis>iso-8859-1</emphasis> или другой набор символов, который поддерживается утилитой iconv</para></listitem>
</itemizedlist>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Функция возвращает строку, которая содержит XML-представление запроса.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Пример клиентской XMLRPC-функции</title>
<programlisting role="php">
<![CDATA[
<?php
$request = xmlrpc_encode_request("method", [1, 2, 3]);
$context = stream_context_create([
'http' => [
'method' => "POST",
'header' => "Content-Type: text/xml",
'content' => $request,
]
]);
$file = file_get_contents("http://www.example.com/xmlrpc", false, $context);
$response = xmlrpc_decode($file);
if ($response && xmlrpc_is_fault($response)) {
trigger_error("xmlrpc: $response[faultString] ($response[faultCode])");
} else {
print_r($response);
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>stream_context_create</function></member>
<member><function>file_get_contents</function></member>
<member><function>xmlrpc_decode</function></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
-->