reference/soap/soapserver/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="soapserver.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
4
<refnamediv>
6
5
<refname>SoapServer::__construct</refname>
...
...
@@ -9,18 +8,118 @@
9
8

10
9
<refsect1 role="description">
11
10
&reftitle.description;
12
-
<methodsynopsis>
11
+
<constructorsynopsis role="SoapServer">
13
12
<modifier>public</modifier> <methodname>SoapServer::__construct</methodname>
14
-
<methodparam><type>mixed</type><parameter>wsdl</parameter></methodparam>
15
-
<methodparam choice="opt"><type>array</type><parameter>options</parameter></methodparam>
16
-
</methodsynopsis>
13
+
<methodparam><type class="union"><type>string</type><type>null</type></type><parameter>wsdl</parameter></methodparam>
14
+
<methodparam choice="opt"><type>array</type><parameter>options</parameter><initializer>[]</initializer></methodparam>
15
+
</constructorsynopsis>
17
16
<para>
18
-
&info.function.alias; <methodname>SoapServer::SoapServer</methodname>
17
+
This constructor allows the creation of <classname>SoapServer</classname>
18
+
objects in WSDL or non-WSDL mode.
19
19
</para>
20
20
</refsect1>
21
21

22
-
</refentry>
22
+
<refsect1 role="parameters">
23
+
&reftitle.parameters;
24
+
<para>
25
+
<variablelist>
26
+
<varlistentry>
27
+
<term><parameter>wsdl</parameter></term>
28
+
<listitem>
29
+
<para>
30
+
To use the SoapServer in WSDL mode, pass the URI of a WSDL file.
31
+
Otherwise, pass &null; and set the <literal>uri</literal> option to the
32
+
target namespace for the server.
33
+
</para>
34
+
</listitem>
35
+
</varlistentry>
36
+
<varlistentry>
37
+
<term><parameter>options</parameter></term>
38
+
<listitem>
39
+
<para>
40
+
Allow setting a default SOAP version (<literal>soap_version</literal>),
41
+
internal character encoding (<literal>encoding</literal>),
42
+
and actor URI (<literal>actor</literal>).
43
+
</para>
44
+
<para>
45
+
The <literal>classmap</literal> option can be used to map some WSDL
46
+
types to PHP classes. This option must be an array with WSDL types
47
+
as keys and names of PHP classes as values.
48
+
</para>
49
+
<para>
50
+
The <literal>typemap</literal> option is an array of type mappings.
51
+
Type mapping is an array with keys <literal>type_name</literal>,
52
+
<literal>type_ns</literal> (namespace URI), <literal>from_xml</literal>
53
+
(callback accepting one string parameter) and <literal>to_xml</literal>
54
+
(callback accepting one object parameter).
55
+
</para>
56
+
<para>
57
+
The <literal>cache_wsdl</literal> option is one of
58
+
<constant>WSDL_CACHE_NONE</constant>,
59
+
<constant>WSDL_CACHE_DISK</constant>,
60
+
<constant>WSDL_CACHE_MEMORY</constant> or
61
+
<constant>WSDL_CACHE_BOTH</constant>.
62
+
</para>
63
+
<para>
64
+
There is also a <literal>features</literal> option which can be set to
65
+
<constant>SOAP_WAIT_ONE_WAY_CALLS</constant>,
66
+
<constant>SOAP_SINGLE_ELEMENT_ARRAYS</constant>,
67
+
<constant>SOAP_USE_XSI_ARRAY_TYPE</constant>.
68
+
</para>
69
+
<para>
70
+
The <literal>send_errors</literal> option can be set to &false; to sent a
71
+
generic error message ("Internal error") instead of the specific error
72
+
message sent otherwise.
73
+
</para>
74
+
</listitem>
75
+
</varlistentry>
76
+
</variablelist>
77
+
</para>
78
+
</refsect1>
79
+

80
+
<refsect1 role="examples">
81
+
&reftitle.examples;
82
+
<para>
83
+
<example>
84
+
<title><function>SoapServer::__construct</function> example</title>
85
+
<programlisting role="php">
86
+
<![CDATA[
87
+
<?php
88
+

89
+
$server = new SoapServer("some.wsdl");
90
+

91
+
$server = new SoapServer("some.wsdl", array('soap_version' => SOAP_1_2));
92
+

93
+
$server = new SoapServer("some.wsdl", array('actor' => "http://example.org/ts-tests/C"));
94
+

95
+
$server = new SoapServer("some.wsdl", array('encoding'=>'ISO-8859-1'));
23
96

97
+
$server = new SoapServer(null, array('uri' => "http://test-uri/"));
98
+

99
+
class MyBook {
100
+
public $title;
101
+
public $author;
102
+
}
103
+

104
+
$server = new SoapServer("books.wsdl", array('classmap' => array('book' => "MyBook")));
105
+

106
+
?>
107
+
]]>
108
+
</programlisting>
109
+
</example>
110
+
</para>
111
+
</refsect1>
112
+

113
+
<refsect1 role="seealso">
114
+
&reftitle.seealso;
115
+
<para>
116
+
<simplelist>
117
+
<member><methodname>SoapClient::__construct</methodname></member>
118
+
</simplelist>
119
+
</para>
120
+
</refsect1>
121
+

122
+
</refentry>
24
123
<!-- Keep this comment at the end of the file
25
124
Local variables:
26
125
mode: sgml
27
126