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

Class: SOAP_Client

Source Location: /SOAP-0.10.0/Client.php

Class Overview

PEAR
   |
   --SOAP_Base_Object
      |
      --SOAP_Base
         |
         --SOAP_Client_Overload
            |
            --SOAP_Client

SOAP Client Class


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods

Class: SOAP_Client_Overload

SOAP_Client_Overload::__call()

Class: SOAP_Base

SOAP_Base::SOAP_Base()
Constructor.
SOAP_Base::makeEnvelope()
Creates the SOAP envelope with the SOAP envelop data.
SOAP_Base::setDefaultNamespace()
Sets the default namespace.
SOAP_Base::setTypeTranslation()
Explicitly sets the translation for a specific class.
SOAP_Base::__set_type_translation()

Class: SOAP_Base_Object

SOAP_Base_Object::SOAP_Base_Object()
Constructor.

Class Details

[line 85]
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 http://dietrich.ganx4.com/soapx4



[ Top ]


Class Variables

$headersIn =  null

[line 172]

The headers we recieved back in the response.

Type:   array


[ Top ]

$headersOut =  null

[line 165]

The array of SOAP_Headers that we are sending.

Type:   array


[ Top ]

$wire =

[line 130]

The outgoing and incoming data stream for debugging.

Type:   string


[ Top ]

$xml =

[line 123]

The received xml.

Type:   string


[ Top ]



Method Detail

SOAP_Client (Constructor)   [line 201]

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

Constructor.
  • See: HTTP_Request
  • Access: public

Parameters:

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 269]

void addHeader( &$soap_value, SOAP_Header $soap_value)

Adds a header to the envelope.
  • Access: public

Parameters:

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

[ Top ]

call   [line 314]

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

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, Content-Transfer-Encoding: header)
   from (SMTP, From: header)
   subject (SMTP, Subject: header)
   headers (SMTP, hash of extra SMTP headers)

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

Parameters:

string   $method     The method to call.
array   $params     The method parameters.
string|array   $namespace     Namespace or hash with options.
string   $soapAction     
   &$params     

[ Top ]

getLastRequest   [line 450]

string getLastRequest( )

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

[ Top ]

getLastResponse   [line 469]

string getLastResponse( )

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

[ Top ]

getWire   [line 845]

string getWire( )

Returns the outgoing and incoming traffic on the transport level.

Tracing has to be enabled.


[ Top ]

parseResponse   [line 756]

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

Parses a SOAP response.
  • See: SOAP_Parser::

Parameters:

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

[ Top ]

setEncoding   [line 250]

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

Parameters:

string   $encoding     encoding

[ Top ]

setOpt   [line 391]

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

Parameters:

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 505]

void setStyle( string $style)

Sets the SOAP encoding style.

Parameters:

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

[ Top ]

setTrace   [line 525]

void setTrace( boolean $trace)

Sets whether to trace the traffic on the transport level.

Parameters:

boolean   $trace     

[ Top ]

setUse   [line 487]

void setUse( string $use)

Sets the SOAP encoding.

Parameters:

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

[ Top ]

_call   [line 422]

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

Parameters:

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 ]

__getlastrequest   [line 439]

void &__getlastrequest( )

  • Deprecated: Use getLastRequest().

[ Top ]

__getlastresponse   [line 458]

void &__getlastresponse( )

  • Deprecated: Use getLastResponse().

[ Top ]

__get_wire   [line 831]

void __get_wire( )

  • Deprecated: Use getWire().

[ Top ]

__parse   [line 742]

void &__parse( &$response, $encoding, &$attachments)

  • Deprecated: Use parseResponse().

Parameters:

   &$response     
   $encoding     
   &$attachments     

[ Top ]

__style   [line 495]

void __style( $style)

  • Deprecated: Use setStyle().

Parameters:

   $style     

[ Top ]

__trace   [line 513]

void __trace( $level)

  • Deprecated: Use setTrace().

Parameters:

   $level     

[ Top ]

__use   [line 477]

void __use( $use)

  • Deprecated: Use setUse().

Parameters:

   $use     

[ Top ]


Documentation generated on Mon, 22 Jan 2007 10:30:18 -0500 by phpDocumentor 1.3.0. PEAR Logo Copyright © PHP Group 2004.