(PHP 5、PHP 7、PHP 8)
SoapVar::__construct — SoapVar 构造函数
$data,$encoding,$typeName = null,$typeNamespace = null,$nodeName = null,$nodeNamespace = null构造一个新的 SoapVar 对象。
data要传递或返回的数据。
encoding编码 ID,XSD_... 常量之一。
type_name类型名称。
type_namespace类型命名空间。
node_nameXML 节点名称。
node_namespaceXML 节点命名空间。
| 版本 | 描述 |
|---|---|
| 8.0.3 |
typeName、typeNamespace、nodeName 和 nodeNamespace 现在可以为 null。 |
示例 #1 SoapVar::__construct() 示例
<?php
类 SOAPStruct {
函数 SOAPStruct($s, $i, $f)
{
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
}
}
$client = new SoapClient(null, array('location' => "https:///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"));
?>