php-src/ext/soap
Dmitry Stogov 6ae97a5b25 WSDL cache was disabled by default (see WSDL_CACHE macro)
WSDL related memory leaks were fixed
2004-02-06 14:22:33 +00:00
..
interop PHP API was changed (see readme.html for more details). 2004-02-05 20:26:05 +00:00
tests PHP API was changed (see readme.html for more details). 2004-02-05 20:26:05 +00:00
config-php4.m4 PHP5 and WIN32 support was improved 2004-02-06 08:01:35 +00:00
config.m4 PHP5 and WIN32 support was improved 2004-02-06 08:01:35 +00:00
config.w32 prefer != "no" over = "yes". (it doesn't really matter for ext/soap, but 2004-02-06 09:18:51 +00:00
EXPERIMENTAL import php-soap library from sourceforge 2002-07-07 23:03:43 +00:00
Makefile.in import php-soap library from sourceforge 2002-07-07 23:03:43 +00:00
package.xml PHP5 support, better encoding and WSDL support, interop round 2 base and groupB 2004-01-05 16:44:01 +00:00
php_encoding.c WSDL cache was disabled by default (see WSDL_CACHE macro) 2004-02-06 14:22:33 +00:00
php_encoding.h WSDL cache was disabled by default (see WSDL_CACHE macro) 2004-02-06 14:22:33 +00:00
php_http.c Initial support for client-part SOAP headers (very incomlete) 2004-02-03 16:44:57 +00:00
php_http.h fix: "Authors" corrected 2004-01-29 11:51:11 +00:00
php_packet_soap.c WSDL parsing speedup. Source cleanup. 2004-02-05 09:28:09 +00:00
php_packet_soap.h Initial support for client-part SOAP headers (very incomlete) 2004-02-03 16:44:57 +00:00
php_schema.c WSDL cache was disabled by default (see WSDL_CACHE macro) 2004-02-06 14:22:33 +00:00
php_schema.h Free XML documents after WSDL parsing (they no longer need). 2004-02-06 11:56:03 +00:00
php_sdl.c WSDL cache was disabled by default (see WSDL_CACHE macro) 2004-02-06 14:22:33 +00:00
php_sdl.h WSDL cache was disabled by default (see WSDL_CACHE macro) 2004-02-06 14:22:33 +00:00
php_soap.dsp Sync with Sourceforge CVS 2002-08-07 03:03:09 +00:00
php_soap.h Free XML documents after WSDL parsing (they no longer need). 2004-02-06 11:56:03 +00:00
php_xml.c PHP5 and WIN32 support was improved 2004-02-06 08:01:35 +00:00
php_xml.h PHP5 and WIN32 support was improved 2004-02-06 08:01:35 +00:00
readme.html PHP5 and WIN32 support was improved 2004-02-06 08:01:35 +00:00
soap.c WSDL cache was disabled by default (see WSDL_CACHE macro) 2004-02-06 14:22:33 +00:00
TODO PHP API was changed (see readme.html for more details). 2004-02-05 20:26:05 +00:00
TODO.old PHP5 support, better encoding and WSDL support, interop round 2 base and groupB 2004-01-05 16:44:01 +00:00

<HTML>
<HEAD>
<TITLE>PHP SOAP Manual</TITLE>
<STYLE>
TR{
	vertical-align: "top";
}
TH{
	text-align: "left";
}
TD:{
	text-align: "left";
}
</STYLE>
</HEAD>
<BODY>
<A name="ref.soap">
<H1>PHP SOAP</H1>
<H2>Introduction</H2>
<TABLE BORDER="1">
<TR><TD ALIGN="center"><B>Warning</B></TD></TR>
<TR><TD ALIGN="left">This extension is <I>EXPERIMENTAL</I>. The behaviour of this extension -- including the names of its functions and anything else documented about this extension -- may change without notice in a future release of PHP. Use this extension at your own risk.
</TD></TR>
</TABLE>
<I>FIXME</I>
<HR>
<H2>Requirements</H2>
This extension makes use of the <A HREF="http://www.xmlsoft.org" TARGET="_top">GNOME XML library</A>. Download and install this library. You will need at least libxml-2.5.4.
<HR>
<H2>Installation</H2>
This extension is only available if PHP was configured with --with-soap.
<HR>
<H2>Predefined Constants</H2>
The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.
<TABLE BORDER="1">
<TR><TH>Constant</TH><TH>Value</TH><TH>Description</TH></TR>
<TR><TH>SOAP_1_1 (integer)</TH><TD>1</TD><TD>SOAP version - SOAP 1.1. Can be used as an option in SoapClient and SoapServer constructors.</TD></TR>
<TR><TH>SOAP_1_2 (integer)</TH><TD>2</TD><TD>SOAP version - SOAP 1.2. Can be used as an option in SoapClient and SoapServer constructors.</TD></TR>
<TR><TH>SOAP_FUNCTIONS_ALL (integer)</TH><TD>999</TD><TD>Allows to export all defined functions with SoapClient::addFunction</TD></TR>
<TR><TH>SOAP_PERSISTENCE_SESSION (integer)</TH><TD>1</TD><TD>Allows making class passed to SoapServer::setClass persistent for a PHP session.</TD></TR>
<TR><TH>SOAP_PERSISTENCE_REQUEST (integer)</TH><TD>2</TD><TD>Allows making class passed to SoapServer::setClass non-persistent for a PHP session.</TD></TR>
<TR><TH>SOAP_ENCODED (integer)</TH><TD>1</TD><TD>Can be passed as <b>style</b> option to SoapClient constructor in nonWSDL mode.</TD></TR>
<TR><TH>SOAP_LITERAL (integer)</TH><TD>2</TD><TD>Can be passed as <b>style</b> option to SoapClient constructor in nonWSDL mode.</TD></TR>
<TR><TH>SOAP_RPC (integer)</TH><TD>1</TD><TD>Can be passed as <b>use</b> option to SoapClient constructor in nonWSDL mode.</TD></TR>
<TR><TH>SOAP_DOCUMENT (integer)</TH><TD>2</TD><TD>Can be passed as <b>use</b> option to SoapClient constructor in nonWSDL mode.</TD></TR>
<TR><TH>SOAP_ACTOR_NEXT (integer)</TH><TD>1</TD><TD>Can be passed as <b>actor</b> to SoapHeader constructor.</TD></TR>
<TR><TH>SOAP_ACTOR_NONE (integer)</TH><TD>2</TD><TD>Can be passed as <b>actor</b> to SoapHeader constructor</TD></TR>
<TR><TH>SOAP_ACTOR_UNLIMATERECEIVER (integer)</TH><TD>3</TD><TD>Can be passed as <b>actor</b> to SoapHeader constructor</TD></TR>
<TR><TH>UNKNOWN_TYPE (integer)</TH><TD>999998</TD><TD>Encoding for unknown type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_STRING (integer)</TH><TD>101</TD><TD>Encoding for standard XMLSchema <b>string</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_BOOLEAN (integer)</TH><TD>102</TD><TD>Encoding for standard XMLSchema <b>boolen</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_DECIMAL (integer)</TH><TD>103</TD><TD>Encoding for standard XMLSchema <b>decimal</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_FLOAT (integer)</TH><TD>104</TD><TD>Encoding for standard XMLSchema <b>float</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_DOUBLE (integer)</TH><TD>105</TD><TD>Encoding for standard XMLSchema <b>double</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_DURATION (integer)</TH><TD>106</TD><TD>Encoding for standard XMLSchema <b>duration</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_DATETIME (integer)</TH><TD>107</TD><TD>Encoding for standard XMLSchema <b>dateTime</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_TIME (integer)</TH><TD>108</TD><TD>Encoding for standard XMLSchema <b>time</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_DATE (integer)</TH><TD>109</TD><TD>Encoding for standard XMLSchema <b>data</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_GYEARMONTH (integer)</TH><TD>110</TD><TD>Encoding for standard XMLSchema <b>gYearMonth</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_GYEAR (integer)</TH><TD>111</TD><TD>Encoding for standard XMLSchema <b>gYear</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_GMONTHDAY (integer)</TH><TD>112</TD><TD>Encoding for standard XMLSchema <b>gMonthDay</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_GDAY (integer)</TH><TD>113</TD><TD>Encoding for standard XMLSchema <b>gDay</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_GMONTH (integer)</TH><TD>114</TD><TD>Encoding for standard XMLSchema <b>gMonth</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_HEXBINARY (integer)</TH><TD>115</TD><TD>Encoding for standard XMLSchema <b>hexBinary</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_BASE64BINARY (integer)</TH><TD>116</TD><TD>Encoding for standard XMLSchema <b>base64Binary</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_ANYURI (integer)</TH><TD>117</TD><TD>Encoding for standard XMLSchema <b>anyURI</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_QNAME (integer)</TH><TD>118</TD><TD>Encoding for standard XMLSchema <b>QName</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_NOTATION (integer)</TH><TD>119</TD><TD>Encoding for standard XMLSchema <b>NOTATION</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_NORMALIZEDSTRING (integer)</TH><TD>120</TD><TD>Encoding for standard XMLSchema <b>normalizedString</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_TOKEN (integer)</TH><TD>121</TD><TD>Encoding for standard XMLSchema <b>token</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_LANGUAGE (integer)</TH><TD>122</TD><TD>Encoding for standard XMLSchema <b>language</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_NMTOKEN (integer)</TH><TD>123</TD><TD>Encoding for standard XMLSchema <b>NMTOKEN</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_NAME (integer)</TH><TD>124</TD><TD>Encoding for standard XMLSchema <b>Name</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_NCNAME (integer)</TH><TD>125</TD><TD>Encoding for standard XMLSchema <b>NCName</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_ID (integer)</TH><TD>126</TD><TD>Encoding for standard XMLSchema <b>ID</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_IDREF (integer)</TH><TD>127</TD><TD>Encoding for standard XMLSchema <b>IDREF</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_IDREFS (integer)</TH><TD>128</TD><TD>Encoding for standard XMLSchema <b>IDREFS</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_ENTITY (integer)</TH><TD>129</TD><TD>Encoding for standard XMLSchema <b>ENTITY</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_ENTITIES (integer)</TH><TD>130</TD><TD>Encoding for standard XMLSchema <b>ENTITIES</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_INTEGER (integer)</TH><TD>131</TD><TD>Encoding for standard XMLSchema <b>integer</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_NONPOSITIVEINTEGER (integer)</TH><TD>132</TD><TD>Encoding for standard XMLSchema <b>nonPositiveInteger</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_NEGATIVEINTEGER (integer)</TH><TD>133</TD><TD>Encoding for standard XMLSchema <b>negativeInteger</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_LONG (integer)</TH><TD>134</TD><TD>Encoding for standard XMLSchema <b>long</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_INT (integer)</TH><TD>135</TD><TD>Encoding for standard XMLSchema <b>int</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_SHORT (integer)</TH><TD>136</TD><TD>Encoding for standard XMLSchema <b>short</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_BYTE (integer)</TH><TD>137</TD><TD>Encoding for standard XMLSchema <b>byte</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_NONNEGATIVEINTEGER (integer)</TH><TD>138</TD><TD>Encoding for standard XMLSchema <b>nonNegativeInteger</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_UNSIGNEDLONG (integer)</TH><TD>139</TD><TD>Encoding for standard XMLSchema <b>unsignedLong</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_UNSIGNEDINT (integer)</TH><TD>140</TD><TD>Encoding for standard XMLSchema <b>unsignedInt</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_UNSIGNEDSHORT (integer)</TH><TD>141</TD><TD>Encoding for standard XMLSchema <b>unsignedShort</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_UNSIGNEDBYTE (integer)</TH><TD>142</TD><TD>Encoding for standard XMLSchema <b>unsignedByte</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_POSITIVEINTEGER (integer)</TH><TD>143</TD><TD>Encoding for standard XMLSchema <b>positiveInteger</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_NMTOKENS (integer)</TH><TD>144</TD><TD>Encoding for standard XMLSchema <b>NMTOKENS</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_ANYTYPE (integer)</TH><TD>145</TD><TD>Encoding for standard XMLSchema <b>anyType</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>SOAP_ENC_ARRAY (integer)</TH><TD>300</TD><TD>Encoding for SOAP <b>Array</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>SOAP_ENC_OBJECT (integer)</TH><TD>301</TD><TD>Encoding for SOAP <b>Struct</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_1999_TIMEINSTANT (integer)</TH><TD>401</TD><TD>Encoding for old XMLSchema <b>timeInstant</b> type. Can be passed to SoapVar constructor.</TD></TR>
<TR><TH>XSD_NAMESPACE (string)</TH><TD>&nbsp;</TD><TD>The XML Schema namespace.</TD></TR>
<TR><TH>XSD_1999_NAMESPACE (string)</TH><TD>&nbsp;</TD><TD>The old XML Schema namespace.</TD></TR>
</TABLE>
<HR>
<H2>Classes</H2>
<h4>List of classes</h4>
<table border="0">
<tr><td><a href="#ref.soap.soapclient">SoapClient</a></td></tr>
<tr><td><a href="#ref.soap.soapserver">SoapServer</a></td></tr>
<tr><td><a href="#ref.soap.soapparam">SoapParam</a></td></tr>
<tr><td><a href="#ref.soap.soapvar">SoapVar</a></td></tr>
<tr><td><a href="#ref.soap.soapheader">SoapHeader</a></td></tr>
</table>
<a name="ref.soap.soapclient">
<h4>SoapClient class</h4>
A SOAP client, that allows calling remote methods on SOAP WebService over HTTP
or HTTPS.
<table border="0">
<tr><td><a href="#ref.soap.soapclient.soapclient">SoapClient</a> -- SoapClient constructor</td></tr>
<tr><td><a href="#ref.soap.soapclient.__call">__call</a> -- calls a SOAP function</td></tr>
<tr><td><a href="#ref.soap.soapclient.__getlastrequest">__getLastRequest</a> -- returns last SOAP request</td></tr>
<tr><td><a href="#ref.soap.soapclient.__getlastresponse">__getLastResponse</a> -- returns last SOAP response</td></tr>
<tr><td><a href="#ref.soap.soapclient.__getfunctions">__getFunctions</a> -- returns list of SOAP functions</td></tr>
<tr><td><a href="#ref.soap.soapclient.__gettypes">__getTypes</a> -- returns list of SOAP types</td></tr>
</table>
<a name="ref.soap.soapserver">
<h4>SoapServer class</h4>
This class can be used to build SOAP WebServices, which can be accessed from
remote SOAP clients over HTTP or HTTPS.
<table border="0">
<tr><td><a href="#ref.soap.soapserver.soapserver">SoapServer</a> -- SoapServer constructor</td></tr>
<tr><td><a href="#ref.soap.soapserver.addfunction">addFunction</a> -- adds one or several functions those will handle SOAP requests</td></tr>
<tr><td><a href="#ref.soap.soapserver.setclass">setClass</a> -- sets class which will handle SOAP requests</td></tr>
<tr><td><a href="#ref.soap.soapserver.getfunctions">getFunctions</a> -- returns list of defined functions</td></tr>
<tr><td><a href="#ref.soap.soapserver.setpersistence">setPersistence</a> -- sets persistence mode of SoapServer</td></tr>
<tr><td><a href="#ref.soap.soapserver.handle">handle</a> -- handles a SOAP request</td></tr>
<tr><td><a href="#ref.soap.soapserver.fault">fault</a> -- generates SOAP fault response</td></tr>
</table>
<a name="ref.soap.soapparam">
<h4>SoapParam class</h4>
<p>
SoapParam is a special low-level class for naming parameters and return values
in nonWSDL mode. It is just a data holder and it has not any special method
except constructor.
</p>
<table border="0">
<tr><td><a href="#ref.soap.soapparam.soapparam">SoapParam</a> -- SoapParam constructor</td></tr>
</table>
<a name="ref.soap.soapvar">
<h4>SoapVar classes</h4>
<p>
SoapVar is a special low-level class for encoding parameters and return values
in  nonWSDL mode. It is just a data holder and it has not any special method
except constructor. It is useful when you like to set type property in SOAP
request or response.
</p>
<table border="0">
<tr><td><a href="#ref.soap.soapvar.soapvar">SoapVar</a> -- SoapVar constructor</td></tr>
</table>
<a name="ref.soap.soapheader">
<h4>SoapHeader class</h4>
<p>
SoapHeader is a special low-level class for passing or returning SOAP headers.
It is just a data holder and it has not any special method except constructor.
</p>
<table border="0">
<tr><td><a href="#ref.soap.soapheader.soapheader">SoapHeader</a> -- SoapHeader constructor</td></tr>
</table>
<HR>
<!--
<H2>Examples</H2>
-->
<h4>Table of Contents</h4>
<table border="0">
<tr><td><a href="#ref.soap.is_soap_fault">is_sopa_fault</a> -- checks if SOAP call was failed</td></tr>
<tr><td><a href="#ref.soap.soapclient.soapclient">SoapClient::SoapClient</a> -- SoapClient constructor</td></tr>
<tr><td><a href="#ref.soap.soapclient.__call">SoapClient::__call</a> -- calls a SOAP function</td></tr>
<tr><td><a href="#ref.soap.soapclient.__getlastrequest">SoapClient::__getLastRequest</a> -- returns last SOAP request</td></tr>
<tr><td><a href="#ref.soap.soapclient.__getlastresponse">SoapClient::__getLastResponse</a> -- returns last SOAP response</td></tr>
<tr><td><a href="#ref.soap.soapclient.__getfunctions">SoapClient::__getFunctions</a> -- returns list of SOAP functions</td></tr>
<tr><td><a href="#ref.soap.soapclient.__gettypes">SoapClient::__getTypes</a> -- returns list of SOAP types</td></tr>
<tr><td><a href="#ref.soap.soapserver.soapserver">SoapServer::SoapServer</a> -- SoapServer constructor</td></tr>
<tr><td><a href="#ref.soap.soapserver.addfunction">SoapServer::addFunction</a> -- adds one or several functions those will handle SOAP requests</td></tr>
<tr><td><a href="#ref.soap.soapserver.setclass">SoapServer::setClass</a> -- sets class which will handle SOAP requests</td></tr>
<tr><td><a href="#ref.soap.soapserver.getfunctions">SoapServer::getFunctions</a> -- returns list of defined functions</td></tr>
<tr><td><a href="#ref.soap.soapserver.setpersistence">SoapServer::setPersistence</a> -- sets persistence mode of SoapServer</td></tr>
<tr><td><a href="#ref.soap.soapserver.handle">SoapServer::handle</a> -- handles a SOAP request</td></tr>
<tr><td><a href="#ref.soap.soapserver.fault">SoapServer::fault</a> -- generates SOAP fault response</td></tr>
<tr><td><a href="#ref.soap.soapparam.soapparam">SoapParam::SoapParam</a> -- SoapParam constructor</td></tr>
<tr><td><a href="#ref.soap.soapvar.soapvar">SoapVar::SoapVar</a> -- SoapVar constructor</td></tr>
<tr><td><a href="#ref.soap.soapheader.soapheader">SoapHeader::SoapHeader</a> -- SoapHeader constructor</td></tr>
</table>

<a name="ref.soap.is_soap_fault"></a>
<h2>is_sopa_fault</h2>
<p>(PHP 5)</p>
<p>checks if SOAP call was failed</p>
<h3>Description</h3>
<p>bool <b>is_soap_fault</b>(mixed obj)</p>
<p>
This function is useful when you like to check if the SOAP call was failed.
In this case SOAP method returns a special SoapFault object which encapsulate
the fault details (faultcode, faultstring, faultactor and faultdetails).
is_soap_fault() functions checks if the given parameter is a SoapFault object.
</p>
<h4>Example</h4>
<TABLE BORDER="0" BGCOLOR="#E0E0E0"><TR><TD><PRE CLASS="php">
&lt;?php
    $client = SoapClient("some.wsdl");
    $result = $client->SomeFunction(...);
    if (is_soap_fault($result)) {
        trigger_error("SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faulstring})", E_ERROR);
    }
?&gt;</PRE></TD></TR></TABLE>

<a name="ref.soap.soapclient.soapclient"></a>
<h2>SoapClient::SoapClient</h2>
<p>(PHP 5)</p>
<p>SoapClient constructor</p>
<h3>Description</h3>
<p><b>SoapClient</b>(mixed wsdl [, array options])</p>
<h4>Examples</h4>
<p>
The constructor allows creating SoapClient objects in WSDL or nonWSDL mode.
The first case requires URI of WSDL file as first parameter and optional
options array. The second case requires NULL as first parameter and options
array with <b>location</b> and <b>uri</b> options set. Where <b>location</b> is
a URL to request and <b>uri</b> is a target namespace of the SOAP service.
<b>style</b> and <b>use</b> options has effect only on nonWSDL (in WSDL mode
they comes from WSDL file). <b>soap_version</b> option allows to work as SOAP 1.1 or
SOAP 1.2 client.
Some additional optional options allow using HTTP authentication (<b>login</b>
and <b>password</b>) and HTTP connection through proxy server (<b>proxy_host</b>,
<b>proxy_port</b>, <b>proxy_login</b> and <b>proxy_password</b>).
</p>
<TABLE BORDER="0" BGCOLOR="#E0E0E0"><TR><TD><PRE CLASS="php">
    $client = new SoapClient("some.wsdl");

    $client = new SoapClient("some.wsdl",array('soap_version'   => SOAP_1_2));

    $client = new SoapClient("some.wsdl",array('login'          => "some_name",
                                               'password'       => "some_password"));

    $client = new SoapClient("some.wsdl",array('proxy_host'     => "localhost",
                                               'proxy_port'     => 8080));

    $client = new SoapClient("some.wsdl",array('proxy_host'     => "localhost",
                                               'proxy_port'     => 8080,
                                               'proxy_login'    => "some_name",
                                               'proxy_password' => "some_password"));

    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
                                        'uri'      => "http://test-uri/"));

    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
                                        'uri'      => "http://test-uri/",
                                        'style'    => SOAP_DOCUMENT,
                                        'use'      => SOAP_LITERAL));
</PRE></TD></TR></TABLE>

<a name="ref.soap.soapclient.__call"></a>
<h2>SoapClient::__call</h2>
<p>(PHP 5)</p>
<p>calls a SOAP function</p>
<h3>Description</h3>
<p>mixed <b>__call</b>(string function_name, array arguments, [array options [, mixed input_headers [, mixed &output_headers]]])</p>
<p>
This is a low level API function to make a SOAP call. Usually in WSDL mode
you can simple call SOAP functions as SoapClient methods. It is useful for
nonWSDL mode when 'soapaction' is unknown, 'uri' is differ form default or
when ypu like to send and/or receive SOAP Headers. To check if function call
is failed check the result with is_soap_fault() function.
</p>
<h4>Examples</h4>
<TABLE BORDER="0" BGCOLOR="#E0E0E0"><TR><TD><PRE CLASS="php">
    $client = new SoapClient("some.wsdl");
    $client->SomeFunction($a,$b,$c);
    $client->__call("SomeFunction",array($a,$b,$c));
    $client->__call("SomeFunction",array($a,$b,$c), NULL,
                    new SoapHeader(...), $output_headers);


    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
                                        'uri'      => "http://test-uri/"));
    $client->SomeFunction($a,$b,$c);
    $client->__call("SomeFunction",array($a,$b,$c));
    $client->__call("SomeFunction",array($a,$b,$c),
                    array('soapaction' => 'some_action',
                          'uri'        => 'some_uri'));
</PRE></TD></TR></TABLE>

<a name="ref.soap.soapclient.__getlastrequest"></a>
<h2>SoapClient::__getLastRequest</h2>
<p>(PHP 5)</p>
<p>returns last SOAP request</p>
<h3>Description</h3>
<p>string <b>__getLastRequest</b>()</p>
<p>
This function works only with SoapClient which was created with trace option.
</p>
<h4>Example</h4>
<TABLE BORDER="0" BGCOLOR="#E0E0E0"><TR><TD><PRE CLASS="php">
&lt;?php
    $client = SoapClient("some.wsdl", array('trace'=>1));
    $result = $client->SomeFunction(...);
    echo "REQUEST:\n".$client->__getLastRequest()."\n";
?&gt;
</PRE></TD></TR></TABLE>

<a name="ref.soap.soapclient.__getlastresponse"></a>
<h2>SoapClient::__getLastResponse</h2>
<p>(PHP 5)</p>
<p>returns last SOAP response</p>
<h3>Description</h3>
<p>string <b>__getLastResponse</b>()</p>
<p>
This function works only with SoapClient which was created with trace option.
</p>
<h4>Example</h4>
<TABLE BORDER="0" BGCOLOR="#E0E0E0"><TR><TD><PRE CLASS="php">
&lt;?php
    $client = SoapClient("some.wsdl", array('trace'=>1));
    $result = $client->SomeFunction(...);
    echo "RESPONSE:\n".$client->__getLastResponse()."\n";
?&gt;
</PRE></TD></TR></TABLE>

<a name="ref.soap.soapclient.__getfunctions"></a>
<h2>SoapClient::__getFunctions</h2>
<p>(PHP 5)</p>
<p>returns list of SOAP functions</p>
<h3>Description</h3>
<p>array <b>__getFunctions</b>()</p>
<p>
This function works only in WSDL mode.
</p>
<h4>Example</h4>
<TABLE BORDER="0" BGCOLOR="#E0E0E0"><TR><TD><PRE CLASS="php">
&lt;?php
    $client = SoapClient("some.wsdl");
    var_dump($client->__getFunctions());
?&gt;
</PRE></TD></TR></TABLE>

<a name="ref.soap.soapclient.__gettypes"></a>
<h2>SoapClient::__getTypes</h2>
<p>(PHP 5)</p>
<p>returns list of SOAP types</p>
<h3>Description</h3>
<p>array <b>__getTypes</b>()</p>
<p>
This function works only in WSDL mode.
</p>
<h4>Example</h4>
<TABLE BORDER="0" BGCOLOR="#E0E0E0"><TR><TD><PRE CLASS="php">
&lt;?php
    $client = SoapClient("some.wsdl");
    var_dump($client->__getTypes());
?&gt;
</PRE></TD></TR></TABLE>

<a name="ref.soap.soapserver.soapserver"></a>
<h2>SoapServer::SoapServer</h2>
<p>(PHP 5)</p>
<p>SoapServer constructor</p>
<h3>Description</h3>
<p><b>SoapServer</b>(mixed wsdl [, array options])</p>
It allows creating SoapServer objects in WSDL or nonWSDL mode. In the first
case  <b>wsdl</b> must be set to URI of WSDL file. In the second <b>wsdl</b>
must be set to null and <b>uti</b> option must be set. Additional options
allow setting a default SOAP version (<b>soap_version</b>) and actor URI
(<b>actor</b>).

<h4>Examples</h4>
<TABLE BORDER="0" BGCOLOR="#E0E0E0"><TR><TD><PRE CLASS="php">
    $server = new SoapServer("some.wsdl");

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

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

    $server = new SoapServer(null,array('uri'=>"http://test-uri/"));
</PRE></TD></TR></TABLE>

<a name="ref.soap.soapserver.addfunction">
<h2>SoapServer::addFunction</h2>
<p>(PHP 5)</p>
<p>adds one or several functions those will handle SOAP requests</p>
<h3>Description</h3>
<p>void <b>addFunction</b>(mixed functions)</p>
Exports one or more functions for remote clients. To export one function pass
function name into <b>functions</b> parameter as string. To export several
functions pass an array of function names and to export all functions pass
a special constant <b>SOAP_FUNCTIONS_ALL</b>.
<h4>Examples</h4>
<TABLE BORDER="0" BGCOLOR="#E0E0E0"><TR><TD><PRE CLASS="php">
    $server->addFunction("func");

    $server->addFunction(array("func1","func2"));

    $server->addFunction(SOAP_FUNCTIONS_ALL);
</PRE></TD></TR></TABLE>

<a name="ref.soap.soapserver.setclass"></a>
<h2>SoapServer::setClass</h2>
<p>(PHP 5)</p>
<p>sets class which will handle SOAP requests</p>
<h3>Description</h3>
<p>void <b>setClass</b>(string class_name [, ...])</p>
Exports all methods from specified class. Additional parameters will be passed
to default class constructor during object creation. The object can be maiden
persistent across request for a given PHP session with
<a href="#ref.soap.soapserver.setpersistence">SoapServer::setPersistence</a> method.
<h4>Examples</h4>
<TABLE BORDER="0" BGCOLOR="#E0E0E0"><TR><TD><PRE CLASS="php">
    $server->setClass("foo");

    $server->setClass("foo", $arg1, $arg2);
</PRE></TD></TR></TABLE>

<a name="ref.soap.soapserver.getfunctions">
<h2>SoapServer::getFunctions</h2>
<p>(PHP 5)</p>
<p>returns list of defined functions</p>
<h3>Description</h3>
<p>array <b>getFunctions</b>()</p>

<a name="ref.soap.soapserver.setpersistence"></a>
<h2>SoapServer::setPersistence</h2>
<p>(PHP 5)</p>
<p>sets persistence mode of SoapServer</p>
<h3>Description</h3>
<p>void <b>setPersistence</b>(int mode)</p>
This function allows saving data between requests in PHP session. It works only
with server that exports functions form class (see
<a href="#ref.soap.soapserver.setclass">SoapServer:setCalss</a>).
<h4>Examples</h4>
<TABLE BORDER="0" BGCOLOR="#E0E0E0"><TR><TD><PRE CLASS="php">
    $server->setpersistence(SOAP_PERSISTENCE_SESSION);

    $server->setpersistence(SOAP_PERSISTENCE_REQUEST);
</PRE></TD></TR></TABLE>

<a name="ref.soap.soapserver.handle"></a>
<h2>SoapServer::handle</h2>
<p>(PHP 5)</p>
<p>handles a SOAP request</p>
<h3>Description</h3>
<p>void <b>handle</b>()</p>
It processes a SOAP request, call necessary functions, and send response back.
It assumes request in global <b>$HTTP_RAW_POST_DATA</b> PHP variable.
<h4>Example</h4>
<TABLE BORDER="0" BGCOLOR="#E0E0E0"><TR><TD><PRE CLASS="php">
&lt;?php
    function test($x) {
        return $x;
    }

    $server = new SoapServer(null,array('uri'=>"http://test-uri/"));
    $server->addFunction("test");
    $server->handle();
?&gt;
</PRE></TD></TR></TABLE>

<a name="ref.soap.soapserver.fault"></a>
<h2>SoapServer::fault</h2>
<p>(PHP 5)</p>
<p>generates SOAP fault response</p>
<h3>Description</h3>
<p>void <b>fault</b>(string faultcode, string faultstring [, string faultactor [, mixed details]])</p>
This function is useful when you like to send SOAP fault response from PHP handler.
It never returns.
<h4>Example</h4>
<TABLE BORDER="0" BGCOLOR="#E0E0E0"><TR><TD><PRE CLASS="php">
&lt;?php
    function test($x) {
        global $server;
        $server->fault("Server","Some error message");
    }

    $server = new SoapServer(null,array('uri'=>"http://test-uri/"));
    $server->addFunction("test");
    $server->handle();
?&gt;
</PRE></TD></TR></TABLE>

<a name="ref.soap.soapparam.soapparam"></a>
<h2>SoapParam::SoapParam</h2>
<p>(PHP 5)</p>
<p>SoapParam constructor</p>
<h3>Description</h3>
<p><b>SoapParam</b>(mixed data, string name)</p>
<p>
SoapParam is a special low-level class for naming parameters and return values
in nonWSDL mode. It is just a data holder and it has not any special method
except constructor. The constructor takes <b>data</b> to pass or return and
<b>name</b>. It is possible to pass parameter directly as PHP value, but in
this case it will be named as <b><i>paramN</i></b> and SOAP Service may not
understand it.
</p>
<h4>Example</h4>
<TABLE BORDER="0" BGCOLOR="#E0E0E0"><TR><TD><PRE CLASS="php">
&lt;?php
    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
                                        'uri'      => "http://test-uri/"));
    $client->SomeFunction(new SoapParam($a,"a"),
                          new SoapParam($b,"b"),
                          new SoapParam($c,"c"));
?&gt;
</PRE></TD></TR></TABLE>

<a name="ref.soap.soapvar.soapvar"></a>
<h2>SoapVar::SoapVar</h2>
<p>(PHP 5)</p>
<p>SoapVar constructor</p>
<h3>Description</h3>
<p><b>SoapVar</b>(mixed data, int encoding [, string type [, string type_ns [, string name [, string name_ns]]]])</p>
<p>
SoapVar is a special low-level class for encoding parameters and return values
in nonWSDL mode. It is just a data holder and it has not any special method
except constructor. It is useful when you like to set type property in SOAP
request or response. The constructor takes <b>data</b> to pass or return,
<b>encoding</b> ID to encode it (see <b><i>XSD_...</i></b> constants) and as
option type name and namespace and value name and namespace.
</p>
<h4>Example</h4>
<TABLE BORDER="0" BGCOLOR="#E0E0E0"><TR><TD><PRE CLASS="php">
&lt;?php
    class SOAPStruct {
    	function SOAPStruct($s, $i, $f) {
    		$this->varString = $s;
    		$this->varInt = $i;
    		$this->varFloat = $f;
    	}
    }
    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
                                        'uri'      => "http://test-uri/"));
    $struct = new SOAPStruct('arg',34,325.325);
    $soapstruct = new SoapVar($struct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd");
    $client->echoStruct(new SoapParam($soapstruct, "inputStruct"));
?&gt;
</PRE></TD></TR></TABLE>

<a name="ref.soap.soapheader.soapheader"></a>
<h2>SoapHeader::SoapHeader</h2>
<p>(PHP 5)</p>
<p>SoapHeader constructor</p>
<h3>Description</h3>
<p><b>SoapHeader</b>(string name_ns, string name [, mixed data [, bool must_understand [, mixed actor]]])</p>
<p>
SoapHeader is a special low-level class for passing or returning SOAP headers.
It is just a data holder and it has not any special method except constructor.
It can be used in <a href="#ref.soap.soapclient.__call">SoapClient::__call</a>
method to pass SOAP header or in SOAP header handler to return header in SOAP
response. <b>name_ns</b> and <b>name</b> are namespace and name of the SOAP
header element. <b>data</b> is a SOAP header's content. It can be a PHP value
or SoapVar object. <b>must_understand</b> and <b>actor</b> are values for
<b><i>mustUnderstand</i></b> and <b><i>actor</i></b> attributes of this SOAP
Header element.
</p>
<h4>Example</h4>
<TABLE BORDER="0" BGCOLOR="#E0E0E0"><TR><TD><PRE CLASS="php">
&lt;?php
    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
                                        'uri'      => "http://test-uri/"));
    $client->__call("echoVoid",NULL,NULL,
                    new SoapHeader('http://soapinterop.org/echoheader/',
                                   'echoMeStringRequest',
                                   'hello world'));
?&gt;
</PRE></TD></TR></TABLE>
</BODY>
</HTML>