php-doc-en/reference/soap/functions/soap-soapclient-call.xml

111 lines
3.7 KiB
XML
Raw Normal View History

<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.soap-soapclient-call">
<refnamediv>
<refname>SoapClient->__call()</refname>
<refpurpose>
Calls a SOAP function
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>SoapClient</classname></ooclass>
<methodsynopsis>
<type>mixed</type>
<methodname>__call</methodname>
<methodparam><type>string</type><parameter>function_name</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>arguments</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>options</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>input_headers</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>output_headers</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
<para>
This is a low level API function to make a SOAP call. Usually in WSDL mode
you can simply call SOAP functions as <classname>SoapClient</classname>
methods. It is useful for non-WSDL mode when <literal>soapaction</literal>
is unknown, <literal>uri</literal> differs from the default or when you like
to send and/or receive SOAP Headers.
</para>
<para>
On error, a call to a SOAP function can cause PHP exceptions or return a
<classname>SoapFault</classname> object if exceptions was disabled.
To check if the function call failed catch the SoapFault exceptions or
check the result with <function>is_soap_fault</function>.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
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.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>SoapClient->__call() Examples</title>
<programlisting role="php">
<![CDATA[
<?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'));
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><xref linkend="function.soap-soapclient-construct" /></member>
<member><xref linkend="function.soap-soapparam-construct" /></member>
<member><xref linkend="function.soap-soapvar-construct" /></member>
<member><xref linkend="function.soap-soapheader-construct" /></member>
<member><xref linkend="function.soap-soapfault-construct" /></member>
<member><function>is_soap_fault</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->