(no version information, might be only in CVS)

SoapVar::SoapVar --  SoapVar constructor


object SoapVar::SoapVar ( mixed data, int encoding [, string type_name [, string type_namespace [, string node_name [, string node_namespace]]]])

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 data to pass or return, encoding ID to encode it (see XSD_... constants) and as option type name and namespace and XML node name and namespace.

例子 1. Some examples

class SOAPStruct {
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", "");
$client->echoStruct(new SoapParam($soapstruct, "inputStruct"));

See also SoapClient::__call() and SoapParam::SoapParam().

虎的笑话 虎的成语 虎的歇后语