SOAP SoapVar::__construct

(PHP 5, PHP 7, PHP 8)

SoapVar::__construct — SoapVar constructor


설명

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

새로운 SoapVar 객체를 생성합니다.


매개변수

data
전달하거나 반환할 데이터입니다.
encoding
인코딩 ID, XSD_... 상수 중 하나.
type_name
유형 이름입니다.
type_namespace
유형 네임스페이스입니다.
node_name
XML 노드 이름입니다.
node_namespace
XML 노드 네임스페이스.

변경 로그

버전 설명
8.0.3 typeName, typeNamespace, nodeNamenodeNamespace는 이제 null을 허용합니다.

Examples

예제 #1 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"));
?>
                  
                

기타