SoapClient->__call()

SoapClient->__call() --  Calls a SOAP function

Description

class SoapClient {

mixed __call ( string function_name [, array arguments [, array options [, array input_headers [, array output_headers]]]] )

}

This is a low level API function to make a SOAP call. Usually in WSDL mode you can simply call SOAP functions as SoapClient methods. It is useful for non-WSDL mode when soapaction is unknown, uri differs from the default or when you like to send and/or receive SOAP Headers.

On error, a call to a SOAP function can cause PHP exceptions or return a SoapFault object if exceptions was disabled. To check if the function call failed catch the SoapFault exceptions or check the result with is_soap_fault().

Return Values

SOAP functions may return one or several values. In the first case it will return just the value of output parameter, in the second it will return the associative array with named output parameters.

Examples

Example 1. SoapClient->__call() Examples

<?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'));
?>

See Also

SoapClient->__construct()
SoapParam->__construct()
SoapVar->__construct()
SoapHeader->__construct()
SoapFault->__construct()
is_soap_fault()