使用 PHP 解析 xml/wsdl 字符串
我使用了 php-curl,这是一个带有 Soap-wsdl 的 Web 服务 API,它不返回 xml 对象,而是返回一个字符串,例如:
string(3854) "<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/ 01/oasis- 200401-wss-wssecurity-utility-1.0.xsd"><s:Header><o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/ wss/2004/ 01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><u:Timestamp u:Id="_0"><u:Created>2022-03-18T01:53:32.688Z</ u:Created> <u:Expires>2022-03-18T01:58:32.688Z</u:Expires></u:Timestamp></o:Security></s:Header><s:Body><UrbanList xmlns="http://tempuri.org/"><D"...
How to Turn the content of this string into an xml and parse this to an array, object, json..除了字符串之外还有什么?
I consumed using php-curl, a webservice API with soap-wsdl which doesn't return an xml object but a string like:
string(3854) "<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/ 01/oasis- 200401-wss-wssecurity-utility-1.0.xsd"><s:Header><o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/ wss/2004/ 01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><u:Timestamp u:Id="_0"><u:Created>2022-03-18T01:53:32.688Z</ u:Created> <u:Expires>2022-03-18T01:58:32.688Z</u:Expires></u:Timestamp></o:Security></s:Header><s:Body><UrbanList xmlns="http://tempuri.org/"><D"...
How to turn the content of this string into an xml and parse this to an array, object, json... anything but a string?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个
Try this