Files
doc-fr/reference/soap/soapfault/construct.xml
George Peter Banyard 5f2061eb94 Apply commit e64ea89bbe0bd2cc28d48adfb3723f9ed5720fd1
Remove PHP4 constructors from ext/soap documentation
2021-01-26 19:14:15 +00:00

161 lines
4.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: e64ea89bbe0bd2cc28d48adfb3723f9ed5720fd1 Maintainer: dams Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="soapfault.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>SoapFault::__construct</refname>
<refpurpose>Constructeur SoapFault</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<constructorsynopsis>
<modifier>public</modifier> <methodname>SoapFault::__construct</methodname>
<methodparam><type class="union"><type>array</type><type>string</type><type>null</type></type><parameter>code</parameter></methodparam>
<methodparam><type>string</type><parameter>string</parameter></methodparam>
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>actor</parameter><initializer>&null;</initializer></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>details</parameter><initializer>&null;</initializer></methodparam>
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>name</parameter><initializer>&null;</initializer></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>headerFault</parameter><initializer>&null;</initializer></methodparam>
</constructorsynopsis>
<para>
<classname>SoapFault</classname> sert à envoyer des erreurs SOAP depuis
le PHP.<parameter>faultcode</parameter>, <parameter>faultstring</parameter>,
<parameter>faultactor</parameter> et <parameter>detail</parameter> sont
les éléments standards SOAP.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>faultcode</parameter></term>
<listitem>
<para>
Le code erreur de <classname>SoapFault</classname>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>faultstring</parameter></term>
<listitem>
<para>
Le message d'erreur de <classname>SoapFault</classname>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>faultactor</parameter></term>
<listitem>
<para>
Une chaîne identifiant l'acteur qui a causé l'erreur.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>detail</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>faultname</parameter></term>
<listitem>
<para>
Peut être utilisé pour sélectionner l'encodage qui convient depuis WSDL.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>headerfault</parameter></term>
<listitem>
<para>
Peut être utilisé durant la gestion de l'entête SOAP pour rapporter
une erreur dans l'en-tête de réponse.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Quelques exemples avec <classname>SoapFault</classname></title>
<programlisting role="php">
<![CDATA[
<?php
function test($x)
{
return new SoapFault("Server", "Un message d'erreur");
}
$server = new SoapServer(null, array('uri' => "http://test-uri/"));
$server->addFunction("test");
$server->handle();
?>
]]>
</programlisting>
</example>
</para>
<para>
Il est possible d'utiliser le mécanisme des exceptions de PHP pour
lancer des exceptions <classname>SoapFault</classname>.
</para>
<para>
<example>
<title>Emission d'exceptions <classname>SoapFault</classname></title>
<programlisting role="php">
<![CDATA[
<?php
function test($x)
{
throw new SoapFault("Server", "Un message d'erreur");
}
$server = new SoapServer(null, array('uri' => "http://test-uri/"));
$server->addFunction("test");
$server->handle();
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><methodname>SoapServer::fault</methodname></member>
<member><function>is_soap_fault</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
-->