(PHP 5, PHP 7, PHP 8)
SoapVar::__construct — SoapVar-Konstruktor
$data
, int|null $encoding
, string $typeName
= ""
, string $typeNamespace
= ""
, string $nodeName
= ""
, string $nodeNamespace
= ""
)Erstellt ein neues SoapVar-Objekt.
data
Die zu übergebenden oder zurückzugebenden Daten.
encoding
Die Encoding-ID, eine der XSD_...
-Konstanten.
type_name
Der Type-Name.
type_namespace
Der Type-Namensraum.
node_name
Der XML-Nodename.
node_namespace
Der XML-Node-Namensraum.
Beispiel #1 SoapVar::__construct()-Beispiel
<?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"));
?>