2011-11-22 3 views
2

불행히도 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(); 
} 
?> 

답변

5

은 정말 실수 해결책은 아주 간단하지 않았다 거기에서 인터넷 접속은 허용되지 않습니다. 내 로컬 시스템에서 잘 작동합니다.

0

또한 내 문제와 마찬가지로 URL에 문제가있을 수 있으며 URL을 포함하는 변수가 시작되는 부분에 오류가 발생하여 오류가 발생했습니다.

관련 문제