불행히도 PHP를 사용하는 간단한 웹 서비스를 사용하려고하면 SOAP URL을 열 수 없지만 브라우저에서 다음과 같은 오류 메시지가 표시됩니다. 잘 작동합니다 (http://www.webservicex.net/uklocation.asmx?WSDL).soapclient returns 외부 엔티티를로드하지 못했습니다.
내 아이디어는 어디에 있습니까?
Errormessages :
Warning: SoapClient::SoapClient(http://www.webservicex.net/uklocation.asmx?WSDL) [soapclient.soapclient]: failed to open stream: Connection timed out in /home/sia-deutschland_de/www/tests/test.php on line 14
Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external entity "http://www.webservicex.net/uklocation.asmx?WSDL" in /home/sia-deutschland_de/www/tests/test.php on line 14 Exception Error!
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.webservicex.net/uklocation.asmx?WSDL' : failed to load external entity "http://www.webservicex.net/uklocation.asmx?WSDL"
그리고 내 코드 : 나는 공유 호스팅 패키지에 코드를 설치 한 것 같다 :
<?php
// include the SOAP classes
require_once('nusoap.php');
try {
$options = array(
'soap_version'=>SOAP_1_2,
'exceptions'=>true,
'trace'=>1,
'cache_wsdl'=>WSDL_CACHE_NONE
);
$client = new SoapClient("http://www.webservicex.net/uklocation.asmx?WSDL", $options);
// Note where 'Get' and 'request' tags are in the XML
//$client = new soapclient("http://www.webservicex.net/uklocation.asmx?WSDL", $options);
$err = $client->getError();
if ($err) {
// Display the error
echo 'client construction error: ' . $err ;
} else {
$answer = $client->call(’GetUKLocationByCounty’,
array(
'Country'=>'London'));
$err = $client->getError();
if ($err) {
// Display the error
echo 'Call error: ' . $err;
print_r($client->response);
print_r($client->getDebug());
} else {
print_r($answer);
}
}
} catch (Exception $e) {
echo "<h2>Exception Error!</h2>";
echo $e->getMessage();
}
?>