reference/soap/soapfault/construct.xml
fe4e8b87d18f17394e7177917c498774b062448c
...
...
@@ -1,6 +1,5 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<refentry xml:id="soapfault.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
4
<refnamediv>
6
5
<refname>SoapFault::__construct</refname>
...
...
@@ -9,23 +8,136 @@
9
8

10
9
<refsect1 role="description">
11
10
&reftitle.description;
12
-
<methodsynopsis>
13
-
<methodname>SoapFault::__construct</methodname>
14
-
<methodparam><type>string</type><parameter>faultcode</parameter></methodparam>
15
-
<methodparam><type>string</type><parameter>faultstring</parameter></methodparam>
16
-
<methodparam choice="opt"><type>string</type><parameter>faultactor</parameter></methodparam>
17
-
<methodparam choice="opt"><type>string</type><parameter>detail</parameter></methodparam>
18
-
<methodparam choice="opt"><type>string</type><parameter>faultname</parameter></methodparam>
19
-
<methodparam choice="opt"><type>string</type><parameter>headerfault</parameter></methodparam>
20
-
</methodsynopsis>
11
+
<constructorsynopsis role="SoapFault">
12
+
<modifier>public</modifier> <methodname>SoapFault::__construct</methodname>
13
+
<methodparam><type class="union"><type>array</type><type>string</type><type>null</type></type><parameter>code</parameter></methodparam>
14
+
<methodparam><type>string</type><parameter>string</parameter></methodparam>
15
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>actor</parameter><initializer>&null;</initializer></methodparam>
16
+
<methodparam choice="opt"><type>mixed</type><parameter>details</parameter><initializer>&null;</initializer></methodparam>
17
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>name</parameter><initializer>&null;</initializer></methodparam>
18
+
<methodparam choice="opt"><type>mixed</type><parameter>headerFault</parameter><initializer>&null;</initializer></methodparam>
19
+
</constructorsynopsis>
21
20
<para>
22
-
&info.function.alias; <methodname>SoapFault::SoapFault</methodname>
21
+
This class is used to send SOAP fault responses from the PHP handler.
22
+
<parameter>faultcode</parameter>, <parameter>faultstring</parameter>,
23
+
<parameter>faultactor</parameter> and <parameter>detail</parameter> are
24
+
standard elements of a SOAP Fault.
23
25
</para>
24
26
</refsect1>
25
27

28
+
<refsect1 role="parameters">
29
+
&reftitle.parameters;
30
+
<para>
31
+
<variablelist>
32
+
<varlistentry>
33
+
<term><parameter>faultcode</parameter></term>
34
+
<listitem>
35
+
<para>
36
+
The error code of the <classname>SoapFault</classname>.
37
+
</para>
38
+
</listitem>
39
+
</varlistentry>
40
+
<varlistentry>
41
+
<term><parameter>faultstring</parameter></term>
42
+
<listitem>
43
+
<para>
44
+
The error message of the <classname>SoapFault</classname>.
45
+
</para>
46
+
</listitem>
47
+
</varlistentry>
48
+
<varlistentry>
49
+
<term><parameter>faultactor</parameter></term>
50
+
<listitem>
51
+
<para>
52
+
A string identifying the actor that caused the error.
53
+
</para>
54
+
</listitem>
55
+
</varlistentry>
56
+
<varlistentry>
57
+
<term><parameter>detail</parameter></term>
58
+
<listitem>
59
+
<para>
60
+
More details about the cause of the error.
61
+
</para>
62
+
</listitem>
63
+
</varlistentry>
64
+
<varlistentry>
65
+
<term><parameter>faultname</parameter></term>
66
+
<listitem>
67
+
<para>
68
+
Can be used to select the proper fault encoding from WSDL.
69
+
</para>
70
+
</listitem>
71
+
</varlistentry>
72
+
<varlistentry>
73
+
<term><parameter>headerfault</parameter></term>
74
+
<listitem>
75
+
<para>
76
+
Can be used during SOAP header handling to report an error in the
77
+
response header.
78
+
</para>
79
+
</listitem>
80
+
</varlistentry>
81
+
</variablelist>
82
+
</para>
83
+
</refsect1>
26
84

27
-
</refentry>
85
+
<refsect1 role="examples">
86
+
&reftitle.examples;
87
+
<para>
88
+
<example>
89
+
<title>Some examples</title>
90
+
<programlisting role="php">
91
+
<![CDATA[
92
+
<?php
93
+
function test($x)
94
+
{
95
+
return new SoapFault("Server", "Some error message");
96
+
}
28
97

98
+
$server = new SoapServer(null, array('uri' => "http://test-uri/"));
99
+
$server->addFunction("test");
100
+
$server->handle();
101
+
?>
102
+
]]>
103
+
</programlisting>
104
+
</example>
105
+
</para>
106
+
<para>
107
+
It is possible to use PHP exception mechanism to throw SOAP Fault.
108
+
</para>
109
+
<para>
110
+
<example>
111
+
<title>Some examples</title>
112
+
<programlisting role="php">
113
+
<![CDATA[
114
+
<?php
115
+
function test($x)
116
+
{
117
+
throw new SoapFault("Server", "Some error message");
118
+
}
119
+

120
+
$server = new SoapServer(null, array('uri' => "http://test-uri/"));
121
+
$server->addFunction("test");
122
+
$server->handle();
123
+
?>
124
+
]]>
125
+
</programlisting>
126
+
</example>
127
+
</para>
128
+
</refsect1>
129
+

130
+
<refsect1 role="seealso">
131
+
&reftitle.seealso;
132
+
<para>
133
+
<simplelist>
134
+
<member><methodname>SoapServer::fault</methodname></member>
135
+
<member><function>is_soap_fault</function></member>
136
+
</simplelist>
137
+
</para>
138
+
</refsect1>
139
+

140
+
</refentry>
29
141
<!-- Keep this comment at the end of the file
30
142
Local variables:
31
143
mode: sgml
32
144