SoapVar::SoapVar

(no version information, might be only in CVS)

SoapVar::SoapVar --  SoapVar コンストラクタ

説明

object SoapVar::SoapVar ( mixed data, int encoding [, string type_name [, string type_namespace [, string node_name [, string node_namespace]]]])

SoapVar は、非WSDLモードでパラメータをエンコードし、値を返すための特別な低レベルクラスです。 このクラスは単にデータを保持するだけで、コンストラクタ以外のメソッドを持ちません。 このクラスは、SOAPリクエストまたはレスポンスで型プロパティを設定したい場合に有用です。 このコンストラクタは、渡したり返したりするdata エンコードを行う encoding ID (XSD_... 定数参照)、そしてオプションとして型 の名前と名前空間、XMLノードの名前と名前空間を引数とします。

例 1. いくつかの例

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

SoapClient::__call() および SoapParam::SoapParam() も参照して下さい。