Jes*_*eth 7 php attributes get soap-client
我已经找到了很多关于SoapClient如何期望你在请求中设置属性的解释,但是我找不到从响应中读取属性的方法.
例如,我的SoapClient响应中包含以下元素:
...
<ns:index>
<ns:uid expdate="2013-09-03 14:30:00">JOWtest002</ns:uid>
<ns:uid expdate="2013-02-07 15:00:00">JOWtest003</ns:uid>
</ns:index>
...
Run Code Online (Sandbox Code Playgroud)
但是,"expdate"属性永远不会附加到"index"stdClass
["index"]=>
object(stdClass)#80 (1) {
["uid"]=>
array(2) {
[0]=>
string(10) "JOWtest002"
[1]=>
string(10) "JOWtest003"
}
}
Run Code Online (Sandbox Code Playgroud)
我已经尝试使用SoapClient类映射将其绑定到对象,但遗憾的是,WSDL没有将"uid"元素定义为complexType,因此它也不映射属性.将"索引"本身绑定到类不起作用.
有什么建议?我真的想避免通过将XML提供给SimpleXML或DOMDocument来解析XML.
| 归档时间: |
|
| 查看次数: |
1284 次 |
| 最近记录: |