File_get_contents () unanswered - php
I am trying to call a webservice that basically looks like this:
So this is how I call this web service:
$endpoint = "http://10.10.10.10:8080/gw/someAction?amount=10&description='Some description'"; $opts = array('http' => array( 'method' => 'GET', 'header' => 'Content-type: application/xml' ) ); $context = stream_context_create( $opts ); $result = file_get_contents( $endpoint, false, $context ); $xml_result = simplexml_load_string( $result ); echo $xml_result->success;
So I got nothing, xml_result is empty. And here's the fun part - when I remove the white space from the description:
Everything is fine, I got a response from the web service. Also tried to call webservice with chrome rest client with space in description and everything is fine, I have an answer. So this leads me to some kind of PHP issue here with spaces in the web service. Please, help!
source to share