PHP Consuming XML Web Serivce (Java)
Not sure what to make of this and fairly new to web serivces.
I've got a Java开发者_开发知识库 webserive that returns a string representation of an XML. That works fine.
I'm trying to call that webservice from a php script using curl_exec, store the string in a variable and then use simplexml_load_string to start rendering the information.
The problem is that for some reason the retrieved informatoin from the webserive seems to be just the content of the xml withuot any of the tags.
Where do I start?
Thanks!
I would suggest you get the raw string returned by the web service, I suggest you use curl from the command line. You could use a browser or wget, but the best way in my opinion is using curl since it's the one handling the requests for PHP in the first place.
After you're certain that the java web service returns the XML as expected, test your PHP code with a sample result from your command line, after which you can go back to debugging your curl_exec request, in case that's where the problem lies.
My suspicion, the java web service doesn't return XML. So I'd start there.
精彩评论