php-doc-en/reference/soap/soapfault/soapfault.xml
Richard Quadling 7bd7f26bed details => detail. Fix#52844
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@303397 c90b9560-bf6c-de11-be94-00142212c4b1
2010-09-15 14:04:48 +00:00

162 lines
4.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="soapfault.soapfault" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>SoapFault::SoapFault</refname>
<refpurpose>SoapFault constructor</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<methodname>SoapFault::SoapFault</methodname>
<methodparam><type>string</type><parameter>faultcode</parameter></methodparam>
<methodparam><type>string</type><parameter>faultstring</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>faultactor</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>detail</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>faultname</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>headerfault</parameter></methodparam>
</methodsynopsis>
<para>
This class is used to send SOAP fault responses from the PHP handler.
<parameter>faultcode</parameter>, <parameter>faultstring</parameter>,
<parameter>faultactor</parameter> and <parameter>detail</parameter> are
standard elements of a SOAP Fault.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>faultcode</parameter></term>
<listitem>
<para>
The error code of the <classname>SoapFault</classname>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>faultstring</parameter></term>
<listitem>
<para>
The error message of the <classname>SoapFault</classname>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>faultactor</parameter></term>
<listitem>
<para>
A string identifying the actor that caused the error.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>detail</parameter></term>
<listitem>
<para>
More details about the cause of the error.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>faultname</parameter></term>
<listitem>
<para>
Can be used to select the proper fault encoding from WSDL.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>headerfault</parameter></term>
<listitem>
<para>
Can be used during SOAP header handling to report an error in the
response header.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Some examples</title>
<programlisting role="php">
<![CDATA[
<?php
function test($x)
{
return new SoapFault("Server", "Some error message");
}
$server = new SoapServer(null, array('uri' => "http://test-uri/"));
$server->addFunction("test");
$server->handle();
?>
]]>
</programlisting>
</example>
</para>
<para>
It is possible to use PHP exception mechanism to throw SOAP Fault.
</para>
<para>
<example>
<title>Some examples</title>
<programlisting role="php">
<![CDATA[
<?php
function test($x)
{
throw new SoapFault("Server", "Some error message");
}
$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
-->