antonb Posted May 21, 2008 Share Posted May 21, 2008 When I run "echo $client->__getLastResponse();" it returns the XML SOAP message in an HTML file. I would like to be able to format this reply into a website automatically but I don't know where to start. Any suggestions? Link to comment https://forums.phpfreaks.com/topic/106653-how-to-automatically-format-soap-responses/ Share on other sites More sharing options...
antonb Posted May 21, 2008 Author Share Posted May 21, 2008 Well I found out one thing. Before you can parse the SOAP response you need to remove some colons with: $response = $client->__getLastResponse(); $clean_response = preg_replace("/(<\/?)(\w+)[^>]*>)/", "$1$2$3", $response); NOW all I have to do is figure out how to parse a normal XML document. There is a ton of documentation on that so I should be all set... I'm a pretty big noob though so who knows. Link to comment https://forums.phpfreaks.com/topic/106653-how-to-automatically-format-soap-responses/#findComment-546744 Share on other sites More sharing options...
antonb Posted May 21, 2008 Author Share Posted May 21, 2008 Soo... when I try to parse the file I get nothin. This is the beginning of the SOAP reply. <soapenvEnvelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenvHeader/><soapenvBody> Notice the <soapenvHeader/> (after I removed the ":" with preg_replace); could this be messing up SimpleXML? Link to comment https://forums.phpfreaks.com/topic/106653-how-to-automatically-format-soap-responses/#findComment-546830 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.