私はZend Soap Serverを持っていて、setUser()操作を作成しました。この操作では、最終的に要求されたデータが使用され、新しいUserオブジェクトが挿入されます。したがって、オブジェクトの値を持つ配列を要求したいと思います。PHP SOAPリクエスト:キーが必要な配列
例:
私は、値のみの数字キーを取得し、私のPHPコードで配列をダンプすると、次のリクエストは基本的に配列<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="...">
<soapenv:Header/>
<soapenv:Body>
<soap:setUser soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<setArray xsi:type="soapenc:Array" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<item xsi:type="xsd:string">John</item>
<item xsi:type="xsd:string">Doe</item>
</setArray>
</soap:setUser>
</soapenv:Body>
</soapenv:Envelope>
のために働く
$request = array("firstname" => "John", "lastname" => "Doe");
setUser($request) { ... }
。
[0] => John
[1] => Doe
キーを指定する方法はありますか?私はすでに試した:
<element name="firstname" xsi:type="xsd:string">John</element>
を私が達成したい:
[firstname] => John
[lastname] => Doe
感謝を。