mirror of
https://github.com/php/doc-es.git
synced 2026-03-24 07:22:16 +01:00
132 lines
3.9 KiB
XML
132 lines
3.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 3abd17e61d5022d503604cc06894254e3281acf5 Maintainer: PhilDaiguille Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<refentry xml:id="function.xmlrpc-encode-request" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>xmlrpc_encode_request</refname>
|
|
<refpurpose>Genera el XML para un método</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>
|
|
Nombre del método a llamar.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>params</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Argumentos del método, compatibles con la firma del método.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>output_options</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Array que especifica las opciones de salida que puede contener (los valores
|
|
por omisión están en negrita):
|
|
<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>
|
|
(puede ser un string con un valor o un array con varios valores)</para></listitem>
|
|
<listitem><para>version: simple, <emphasis>xmlrpc</emphasis>, soap 1.1, auto</para></listitem>
|
|
<listitem><para>encoding: <emphasis>iso-8859-1</emphasis>, otros juegos de caracteres soportados por iconv</para></listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve un string que contiene la representación XML de la solicitud.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo con 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
|
|
-->
|