soapclient::__call

(no version information, might be only in CVS)

soapclient::__call --  Appelle une fonction SOAP

Description

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

soapclient::__call() est une fonction bas niveau pour réaliser un appel SOAP. Généralement en mode WSDL, vous pouvez simplement appeler les fonctions SOAP comme des méthodes. Cette méthode est pratique en mode non-WSDL, lorsque soapaction est inconnu, uri diffère de la valeur par défaut, ou si vous envoyerz et/ou recevez des entêtes SOAP. En cas d'erreur, une exception PHP est émise, ou bien un objet SoapFault est retourné sir les exceptions sont désactivées. Pour vérifier qu'un appel a échoué, interceptez les exception SoapFault, ou bien vérifiez le résultat avec la fonction is_soap_fault().

Les fonctions SOAP peuvent retourner une ou plusieurs valeurs. Dans le premier cas, elle retournera simplement la valeur, et dans le second cas, elle retournera un tableau associatif.

Exemple 1. Exemple avec soapclient::__call()

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

Voir aussi soapclient::soapclient(), soapparam::soapparam(), soapvar::soapvar(), soapheader::soapheader(), soapfault::soapfault() et is_soap_fault().