このようなオブジェクトの多次元配列のPHPからの応答を取得しようとしています
[CartItems] => Array
(
[15] => stdClass Object
(
[key] => 15
[value] => stdClass Object
(
[Item] => stdClass Object
(
[id] => 1
[quantity] => 7
)
)
)
[25] => stdClass Object
(
[key] => 25
[value] => stdClass Object
(
[Item] => stdClass Object
(
[id] => 1
[quantity] => 5
)
)
)
[26] => stdClass Object
(
[key] => 26
[value] => stdClass Object
(
[Item] => stdClass Object
(
[id] => 1
[quantity] => 5
)
)
)
)
WSDLファイルで配列型を試しました
<xsd:complexType name="ArrayOfProducts">
<xsd:complexContent>
<xsd:restriction base="soapenc:Array">
<xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="Product[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
ここでの主なポイントは、キーを使用して直接アクセス可能な要素を含む配列「CartItems」を返したいということです。
私は特にこのソリューションに依存していません。目的のオブジェクトを見つけるためにすべての配列をウォークスルーせずに、すべてのオブジェクトに直接アクセスしたいだけです。