PHP 手冊
上一頁 |  | 下一頁

# SoapClient::__call

(no version information, might be only in CVS)

SoapClient::__call -- Calls a SOAP function

## Description

mixed SoapClient::__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 the is_soap_fault() function.

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.

示範 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::SoapClient(), SoapParam::SoapParam(), SoapVar::SoapVar(), SoapHeader::SoapHeader(), SoapFault::SoapFault(), and is_soap_fault().

上一頁 | 最開頭 | 下一頁
SoapClient::SoapClient | 上一層 | SoapClient::__getFunctions