【发布时间】:2010-11-27 01:55:11
【问题描述】:
我正在尝试在我的 SOAP 调用中生成以下 XML:
<CResponse>
<ID>int</ID>
<Response Action="Apply">
<Question ID="$someint">
<Responses>
<Response ID="$someotherint" />
<Response ID="$yetanotherint" />
</Responses>
</Question>
</Response>
</CResponse>
我可以很好地创建大部分调用 - 我终于知道嵌套数组是我的朋友 - 但我不知道如何将这些 ID="$int" 和 Action="Apply" 属性添加到各种标签。我敢肯定这很容易,但我就是想不通。
TIA。
【问题讨论】:
-
你是如何创建 XML 的?
-
只是将它作为参数传递给我的 SOAP 函数调用。所以,假设 $client 是我的 SOAP 句柄,它是 $result = $client->NameOfFunction(array(whatever => whatever));
-
$client 到底是什么?是uk.php.net/manual/en/class.soapclient.php 吗?
-
这个问题被转发了,见stackoverflow.com/questions/1408748/…。
-
@benjy:您不应该立即重新发布未解决的问题,如果出现新问题,只需编辑/增强原始问题。我在这里回答,因为这似乎是原始问题,而且标题更好。