SOAP Web Service Tutorials - Herong's Tutorial Examples - v5.13, by Herong Yang
PHP SOAP Extension Functions for Client Programs
This section describes client side functions of the PHP SOAP Extension.
If you read the SOAP Extension reference page, you will see that SOAP Extension support SOAP client applications with a class called SoapClient, which offers the following functions:
SoapClient->__construct() allows you to construct a new SoapClient object with the following syntax:
__construct ( mixed wsdl [, array options] );
where "wsdl" specifies the URL of the WSDL document, and "options" specifies a list of options:
'location' => "...", # the URL where to send the request 'uri' => "...", # the name space of the SOAP service 'soap_version' => SOAP_1_1 |SOAP_1_2, 'trace' => 0 | 1, ...
Note that SoapClient object can be constructed in two modes, WSDL mode and non-WSDL mode:
__construct( "..."[, array options] ); # WSDL mode, many options # are provided by the WSDL document __construct( null, array options ); # non-WSDL mode, 'location' # and 'uri' are required options.
SoapClient->__getFunctions() allows you to get a list of functions supported by the target node. This function is only valid in WSDL mode:
array $a = $obj->__getFunctions();
SoapClient->__getTypes() allows you to get a list of types supported by the target node. This function is only valid in WSDL mode:
array $a = $obj->__getTypes();
SoapClient->__soapCall() allows you to make a RPC function call on the target SOAP node. In WSDl mode, You can also call any operation directly as if it's an object function.
$obj->__soapCall(string func_name[, array arguments [, ...]]);
Note that in WSDL mode, you can also make a RPC call as a local method on the SoapClient object:
$obj->func_name(arg1, arg2, ...);
SoapClient->__getLastRequestHeaders() allows you to retrieve the HTTP request header lines of the last SOAP request executed. This function works only if the SoapClient object was created with the option of "trace=1".
string $s = $obj->__getLastRequestHeaders();
SoapClient->__getLastRequest() allows you to retrieve SOAP request message of the last SOAP request executed. This function works only if the SoapClient object was created with the option of "trace=1".
string $s = $obj->__getLastRequest();
SoapClient->__getLastResponseHeaders() allows you to retrieve the HTTP response header lines of the last SOAP request executed. This function works only if the SoapClient object was created with the option of "trace=1".
string $s = $obj->__getLastRequestHeaders();
SoapClient->__getLastResponse() allows you to retrieve SOAP response message of the last SOAP request executed. This function works only if the SoapClient object was created with the option of "trace=1".
string $s = $obj->__getLastResponse();
Table of Contents
Introduction to SOAP (Simple Object Access Protocol)
SOAP Message Transmission and Processing
SOAP MEP (Message Exchange Patterns)
►PHP SOAP Extension Client Programs
►PHP SOAP Extension Functions for Client Programs
Calling WSDL Operation Directly
Call WSDL Operation with SoapClient::__soapCall()
Dumping SOAP Request and Response
Call WSDL Operation with SoapClient::__doRequest()
PHP SOAP Extension Server Programs
PHP SOAP Web Service Example - getTemp
Perl SOAP::Lite - SOAP Server-Client Communication Module
Perl Socket Test Program for HTTP and SOAP
Perl SOAP::Lite for NumberToWords SOAP 1.1 Web Service
Perl SOAP::Lite for SOAP 1.2 Web Services
Java Socket and HttpURLConnection for SOAP
SAAJ - SOAP with Attachments API for Java
SoapUI - SOAP Web Service Testing Tool
WS-Security - SOAP Message Security Extension
WS-Security X.509 Certificate Token
Perl SOAP::Lite for GetSpeech SOAP 1.1 Web Service
Perl SOAP::Lite 0.710 for SOAP 1.2 Web Services
Perl SOAP::Lite 0.710 for WSDL