1
0
mirror of https://github.com/php/doc-ru.git synced 2026-03-26 00:32:15 +01:00
Files
archived-doc-ru/reference/xmlrpc/functions/xmlrpc-encode-request.xml
Sergey Panteleev daef8df962 Обнуление тега Reviewed (#364)
[skip-lint]
[skip-spellcheck]
2021-11-16 13:03:53 +03:00

127 lines
4.1 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: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 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", array(1, 2, 3));
$context = stream_context_create(array('http' => array(
'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
-->