PHP 8.3.23 Released!

SoapVar::__construct

(PHP 5, PHP 7, PHP 8)

SoapVar::__constructConstructor de SoapVar

Descripción

public SoapVar::__construct(
    mixed $data,
    ?int $encoding,
    ?string $typeName = null,
    ?string $typeNamespace = null,
    ?string $nodeName = null,
    ?string $nodeNamespace = null
)

Construye un nuevo objeto SoapVar.

Parámetros

data

Los datos a pasar o a devolver.

encoding

El ID de codificación, una de las constantes XSD_....

typeName

El nombre del tipo.

typeNamespace

El tipo del espacio de nombres.

nodeName

El nombre del nodo XML.

nodeNamespace

El espacio de nombres del nodo XML.

Historial de cambios

Versión Descripción
8.0.3 typeName, typeNamespace, nodeName, y nodeNamespace ahora son nullable.

Ejemplos

Ejemplo #1 Ejemplo con SoapVar::__construct()

<?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"));
?>

Ver también

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top