猿问

php解析xml问题

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

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

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

慕莱坞森
浏览 650回答 1
1回答

回首忆惘然

参考 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
随时随地看视频慕课网APP
我要回答