SoapVar::__construct
(PHP 5, PHP 7, PHP 8)
SoapVar::__construct — SoapVar-Konstruktor
Beschreibung
mixed
$data,?int
$encoding,?string
$typeName = null,?string
$typeNamespace = null,?string
$nodeName = null,?string
$nodeNamespace = null)
Erstellt ein neues SoapVar-Objekt.
Parameter-Liste
-
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.
Changelog
| Version | Beschreibung |
|---|---|
| 8.0.3 |
typeName, typeNamespace,
nodeName und
nodeNamespace sind jetzt nullable (akzeptieren
den NULL-Wert).
|
Beispiele
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"));
?>
Siehe auch
- SoapClient::__soapCall() - Ruft eine SOAP-Funktion auf
- SoapParam::__construct() - SoapParam-Konstruktor

