0
我需要通过SOAP传递多个NameValueLists,但我不知道如何包含他们的数据。易趣交易API:通过SOAP传递具有相同名称的元素
那应该如何看起来像:
<Variations>
<VariationSpecificsSet>
<NameValueList>
<Name>Size</Name>
<Value>XL</Value>
</NameValueList>
<NameValueList>
<Name>Color</Name>
<Value>Black</Value>
</NameValueList>
</VariationSpecificsSet>
</Variations>
我的PHP代码部分:$ PARAMS
$params->Item->Variations = new ArrayObject();
$params->Item->Variations->VariationSpecificsSet = new ArrayObject();
$params->Item->Variations->VariationSpecificsSet->NameValueList = new ArrayObject();
$list = new ArrayObject();
$list->name = 'title';
$list->value = "value";
$arr[0] = $list;
$arr[1] = $list;
$params->Item->Variations->VariationSpecificsSet->NameValueList = $arr;
$ebay->ebayCall("VerifyAddFixedPriceItem", $params);
调试输出:
[Variations] => ArrayObject Object
(
[VariationSpecificsSet] => ArrayObject Object
(
[NameValueList] => Array
(
[0] => ArrayObject Object
(
[name] => title
[value] => value
[storage:ArrayObject:private] => Array
(
)
)
[1] => ArrayObject Object
(
[name] => title
[value] => value
[storage:ArrayObject:private] => Array
(
)
)
[2] => ArrayObject Object
(
[name] => title
[value] => value
[storage:ArrayObject:private] => Array
(
)
)
)
[storage:ArrayObject:private] => Array
(
)
)
[storage:ArrayObject:private] => Array
(
)
)
产生的请求:没有名字,NameValueLists中的值都不是
<ns1:Variations>
<ns1:VariationSpecificsSet>
<ns1:NameValueList/>
<ns1:NameValueList/>
<ns1:NameValueList/>
</ns1:VariationSpecificsSet>
</ns1:Variations>
如何正确地将数据放在NameValueLists中?调试输出对我来说似乎很好,但它不会显示在xml中。我不能成为第一个..?
编辑:我发现了一个SO疑问,精确地描述了我的问题:我问在这里尝试过这种方法 Php soap client multiple node ,但它仍然没有为我工作。我猜,这与eBay wsdl有关,但我无法弄清楚究竟是什么