0

i have a php soapserver running. it is written with the native php soap extension. This service loads a local file and handles it.

file_get_contents("C:/xampp/htdocs/test.xml");

but if i try to get a webserver file like this

file_get_contents("http://192.168.10.11/test.xml");

it doesnt work and the webservie returns "faild to load external entity http"

are there any restrictions in a php soapserver that i can't get file over http????

the actual problem is, that i want to call a webservice inside that soapserver. like a webservice chain... but this always fails with the above error message...

do you have any solutions for this?

Thanks a lot!

user1857519
  • 119
  • 1
  • 2
  • 8
  • try this links http://stackoverflow.com/questions/2897495/failed-to-load-external-entity-error-on-soap http://developer.affili.net/desktopdefault.aspx/tabid-104/218_read-26/topic-88/ And `CURL` is better than `file_get_contents ` – Yogesh Suthar Feb 22 '13 at 07:05

1 Answers1

1

I like using curl:

$curl_init = curl_init();
curl_setopt($curl_init, CURLOPT_URL, 'http://example.com/test.xml');
curl_setopt($curl_init, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($curl_init);

I don't see why what you are doing shouldn't work though. Sometimes a server can be slow to close a connection... up to 90 seconds according to this post: PHP file_get_contents very slow when using full url

You are sure the url is correct? Can you access it in the browser?

Community
  • 1
  • 1
span
  • 5,405
  • 9
  • 57
  • 115
  • actually the problem is not the file_get_contents, i used this just to demonstrate the issue. What i am trying to do is to get a client inside the soapserver by $client = new SoapClient("http://192.168.10.11/test.wsdl"); so that means the soapclient is wrapped in the soapserver. When i try to access the soapserver via soapui, the above declartion always fails with the error msg "failed to load external entity" btw the wsdl file and server are accessible and valid – user1857519 Feb 22 '13 at 08:41