[ class tree: SOAP ] [ index: SOAP ] [ all elements ]

Class: SOAP_Client

Source Location: /SOAP-0.13.0/SOAP/Client.php

Class Overview


SOAP Client Class




Inherited Variables

Inherited Methods

Class: SOAP_Client_Overload


Class: SOAP_Base

Creates the SOAP envelope with the SOAP envelop data.
Sets the default namespace.
Explicitly sets the translation for a specific class.
Sets the SOAP-ENC prefix and returns the current value.
Sets the SOAP-ENV prefix and returns the current value.

Class: SOAP_Base_Object


Class Details

[line 89]
SOAP Client Class

This class is the main interface for making soap requests.

basic usage:

  1.    $soapclient = new SOAP_Clientstring path boolean wsdl);
  2.    echo $soapclient->callstring methodname array parameters);
or, if using PHP 5+ or the overload extension:
  1.    $soapclient = new SOAP_Clientstring path boolean wsdl);
  2.    echo $soapclient->methodnamearray parameters);

Originally based on SOAPx4 by Dietrich Ayala

[ Top ]

Class Variables

$headersIn =  null

[line 176]

The headers we recieved back in the response.

Type:   array

[ Top ]

$headersOut =  null

[line 169]

The array of SOAP_Headers that we are sending.

Type:   array

[ Top ]

$wire =

[line 134]

The outgoing and incoming data stream for debugging.

Type:   string

[ Top ]

$xml =

[line 127]

The received xml.

Type:   string

[ Top ]

Method Detail

SOAP_Client (Constructor)   [line 205]

SOAP_Client SOAP_Client( string $endpoint, [boolean $wsdl = false], [string $portName = false], [array $proxy_params = array()], [boolean|string $cache = false])

  • See: HTTP_Request
  • Access: public


string   $endpoint   —  An URL.
boolean   $wsdl   —  Whether the endpoint is a WSDL file.
string   $portName   —  The service's port name to use.
array   $proxy_params   —  Options for the HTTP_Request class
boolean|string   $cache   —  Use WSDL caching? The cache directory if a string.

[ Top ]

addHeader   [line 273]

void addHeader( SOAP_Header $soap_value)

Adds a header to the envelope.
  • Access: public


SOAP_Header   $soap_value   —  A SOAP_Header or an array with the elements 'name', 'namespace', 'mustunderstand', and 'actor' to send as a header.

[ Top ]

call   [line 328]

mixed call( string $method, array $params, [string|array $namespace = false], [string $soapAction = false])

Calls a method on the SOAP endpoint.

The namespace parameter is overloaded to accept an array of options that can contain data necessary for various transports if it is used as an array, it MAY contain a namespace value and a soapaction value. If it is overloaded, the soapaction parameter is ignored and MUST be placed in the options array. This is done to provide backwards compatibility with current clients, but may be removed in the future. The currently supported values are:

  • 'namespace'
  • 'soapaction'
  • 'timeout': HTTP socket timeout
  • 'transfer-encoding': SMTP transport, Content-Transfer-Encoding: header
  • 'from': SMTP transport, From: header
  • 'subject': SMTP transport, Subject: header
  • 'headers': SMTP transport, hash of extra SMTP headers
  • 'attachments': what encoding to use for attachments (Mime, Dime)
  • 'trace': whether to trace the SOAP communication
  • 'style': 'document' or 'rpc'; when set to 'document' the parameters are not wrapped inside a tag with the SOAP action name
  • 'use': 'literal' for literal encoding, anything else for section 5 encoding; when set to 'literal' SOAP types will be omitted.
  • 'keep_arrays_flat': use the tag name multiple times for each element when passing in an array in literal mode
  • 'no_type_prefix': supress adding of the namespace prefix

  • Return: The method result or a SOAP_Fault on error.
  • Access: public


string   $method   —  The method to call.
array   $params   —  The method parameters.
string|array   $namespace   —  Namespace or hash with options. Note: most options need to be repeated for SOAP_Value instances.
string   $soapAction   — 

[ Top ]

getLastRequest   [line 454]

string getLastRequest( )

Returns the XML content of the last SOAP request.
  • Return: The last request.

[ Top ]

getLastResponse   [line 464]

string getLastResponse( )

Returns the XML content of the last SOAP response.
  • Return: The last response.

[ Top ]

getWire   [line 824]

string getWire( )

Returns the outgoing and incoming traffic on the transport level.

Tracing has to be enabled.

[ Top ]

parseResponse   [line 732]

void parseResponse( string $response, string $encoding, array $attachments)

Parses a SOAP response.
  • See: SOAP_Parser::


string   $response   —  XML content of SOAP response.
string   $encoding   —  Character set encoding, defaults to 'UTF-8'.
array   $attachments   —  List of attachments.

[ Top ]

setEncoding   [line 254]

mixed setEncoding( string $encoding)

Sets the character encoding.

Limited to 'UTF-8', 'US_ASCII' and 'ISO-8859-1'.

  • Return: SOAP_Fault on error.
  • Access: public


string   $encoding   —  encoding

[ Top ]

setOpt   [line 404]

void setOpt( string $category, string $option, [string $value = null])

Sets an option to use with the transport layers.

For example:

  1.  $soapclient->setOpt('curl'CURLOPT_VERBOSE1)
to pass a specific option to curl if using an SSL connection.

  • Access: public


string   $category   —  Category to which the option applies or option name.
string   $option   —  An option name if $category is a category name, an option value if $category is an option name.
string   $value   —  An option value if $category is a category name.

[ Top ]

setStyle   [line 488]

void setStyle( string $style)

Sets the SOAP encoding style.

The default style is rpc.


string   $style   —  Either 'document' or 'rpc'.

[ Top ]

setTrace   [line 500]

void setTrace( boolean $trace)

Sets whether to trace the traffic on the transport level.


boolean   $trace   — 

[ Top ]

setUse   [line 476]

void setUse( string $use)

Sets the SOAP encoding.

The default encoding is section 5 encoded.


string   $use   —  Either 'literal' or 'encoded' (section 5).

[ Top ]

_call   [line 435]

boolean _call( string $method, array $params, &$return_value, mixed $return_value)

Call method supporting the overload extension.

If the overload extension is loaded, you can call the client class with a soap method name:

  1.  $soap = new SOAP_Client(....);
  2.  $value $soap->getStockQuote('MSFT');

  • Return: Always true.
  • Access: public


string   $method   —  The method to call.
array   $params   —  The method parameters.
mixed   $return_value   —  Will get the method's return value assigned.
   &$return_value   — 

[ Top ]

Documentation generated on Mon, 11 Mar 2019 15:47:18 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.