php-doc-en/reference/soap/functions/SoapVar-SoapVar.xml
Jakub Vrana 28a256225c Change "object" to specific objects
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@172545 c90b9560-bf6c-de11-be94-00142212c4b1
2004-11-12 12:53:22 +00:00

81 lines
2.8 KiB
XML

<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.5 $ -->
<refentry id="function.SoapVar-SoapVar">
<refnamediv>
<refname>SoapVar::SoapVar</refname>
<refpurpose>
SoapVar constructor
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>SoapVar</type><methodname>SoapVar::SoapVar</methodname>
<methodparam><type>mixed</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>encoding</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>type_name</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>type_namespace</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>node_name</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>node_namespace</parameter></methodparam>
</methodsynopsis>
<para>
SoapVar is a special low-level class for encoding parameters and returning
values in non-WSDL mode. It is just a data holder and does not have any
special methods except the constructor. It is useful when you would like to set
the type property in SOAP request or response. The constructor takes
<parameter>data</parameter> to pass or return, <parameter>encoding</parameter>
ID to encode it (see <literal>XSD_...</literal> constants) and as option type
name and namespace and XML node name and namespace.
</para>
<para>
<example>
<title>Some examples</title>
<programlisting role="php">
<![CDATA[
<?php
class SOAPStruct {
function SOAPStruct($s, $i, $f)
{
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
}
}
$client = new SoapClient(null, array('location' => "http://localhost/soap.php",
'uri' => "http://test-uri/"));
$struct = new SOAPStruct('arg', 34, 325.325);
$soapstruct = new SoapVar($struct, SOAP_ENC_OBJECT, "SOAPStruct", "http://soapinterop.org/xsd");
$client->echoStruct(new SoapParam($soapstruct, "inputStruct"));
?>
]]>
</programlisting>
</example>
</para>
<para>
See also
<function>SoapClient::__call</function> and
<function>SoapParam::SoapParam</function>.
</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
-->