PHP Parse Soap Response Issue - SimpleXMLElement

大兔子大兔子 提交于 2019-12-06 15:49:34

SimpleXML creates a tree object, so you have to follow that tree to get to the nodes you want.

Also, you have to use the actual namespace URI when accessing it, e.g.: urn:eCaseWSDL instead of ns1:

Try this:

$soap = $xml_element->children($name_spaces['SOAP-ENV'])
                    ->Body
                    ->children($name_spaces['ns1'])
                    ->registerDocumentByPatientResponse
                    ->children();

var_dump((string)$soap->returnArray->id); // 138
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!