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->__soapCall() allows you to make a RPC function call on the target SOAP node.

   $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();

Last update: 2007.

Table of Contents

 About This Book

 Introduction to Web Service

 Introduction to SOAP (Simple Object Access Protocol)

 SOAP Message Structure

 SOAP Message Transmission and Processing

 SOAP Data Model

 SOAP Encoding

 SOAP RPC Presentation

 SOAP Properties Model

 SOAP Message Exchange Patterns

 SOAP HTTP Binding

 SOAP Perl Implementations

 SOAP PHP Implementations

 SOAP Java Implementations

 Perl SOAP::Lite - SOAP Server-Client Communication Module

 Perl Socket Test Program for HTTP and SOAP

 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

PHP SOAP Extension Client Programs

 What Is PHP SOAP Extension?

 GetTemp.php - First Example with SOAP

PHP SOAP Extension Functions for Client Programs

 GetTempDump.php - Dumping Debugging Information

 Whis Is WSDL (Web Services Definition Language)?

 Using SOAP Extension in non-WDSL Mode

 PHP SOAP Extension Server Programs

 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

 Web Services and SOAP Terminology

 References

 PDF Printing Version