首页 新闻 会员 周边

php解析xml问题

0
悬赏园豆:5 [已解决问题] 解决于 2018-01-24 16:15

这种xml怎么解析,java接口返回的数据。解析时候报错:

simplexml_load_string(): namespace error : Namespace prefix client on RETCODE is not defined

原因是:env:Envelope这种节点,找不到env这个命名空间

lippor的主页 lippor | 初学一级 | 园豆:51
提问于:2018-01-24 14:49
< >
分享
最佳答案
0

参考 Parsing SOAP responses with PHP's SimpleXML

SOAP responses contain namespaces on some if not all of the nodes and SimpleXML doesn’t really care for that when using the traditional method of interaction. To accomplish this, you will need to use the SimpleXMLElement::children() method to specify the namespace

收获园豆:5
dudu | 高人七级 |园豆:30994 | 2018-01-24 15:01

按照这里面没解决,最后用正则解决的。

lippor | 园豆:51 (初学一级) | 2018-01-24 16:16
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册