2013-01-15 71 views
1

我不能跟我的橙服務器連接到我的網站,這個錯誤是來了:PHP OOP致命錯誤:未捕獲的SOAPFault例外:

我已經啓用了SSL和肥皂,但它仍然無法正常工作。

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: 
Parsing WSDL: Couldn't load from 'https://m2mconnect.orange.co.uk/orange-soap/services/MessageServiceByCountry?wsdl': 
Start tag expected, '<' not found in C:\xampp\htdocs\test\library\connect.class.php:10 

Stack trace: #0 C:\xampp\htdocs\test\library\connect.class.php(10): SoapClient->SoapClient('https://m2mconn...') 
#1 C:\xampp\htdocs\test\application\views\items\homepage.php(20): Connect->__construct() 
#2 C:\xampp\htdocs\test\library\template.class.php(30): include('C:\xampp\htdocs...') 
#3 C:\xampp\htdocs\test\library\controller.class.php(25): Template->render() 
#4 C:\xampp\htdocs\test\library\shared.php(91): Controller->__destruct() 
#5 C:\xampp\htdocs\test\library\shared.php(91): callHook() 
#6 C:\xampp\htdocs\test\library\bootstrap.php(4): require_once('C:\xampp\htdocs...') 
#7 C:\xampp\htdocs\test\public\index.php(8): require_once('C:\xampp\htdocs...') 
#8 {main} thrown in C:\xampp\htdocs\test\library\connect.class.php on line 10 
+0

'預計開始標記,'<'找不到'應該很清楚嗎?我會查看下載的源代碼,那裏可能有錯誤。 –

回答

1

嘗試使用WSDL保存到本地文件,並參考在你的構造......

$client = new SoapClient('/local/path/to/wsdlfile.wsdl'); 

編輯:如果您在使用文件系統越來越HTTP錯誤,你正在做的東西錯了:-)

試圖自己運行這個,這些是我的迴應。 注:我已經連接到服務器的橙色以及麻煩,可能是他們的HTTPS連接是有點臭...

瓦爾突降新SoapClient的:

$> php -r "var_dump(new SoapClient('https://m2mconnect.orange.co.uk/orange-soap/services/MessageServiceByCountry?wsdl'));" 
PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://m2mconnect.orange.co.uk/orange-soap/services/MessageServiceByCountry?wsdl' : 
failed to load external entity "https://m2mconnect.orange.co.uk/orange-soap/services/MessageServiceByCountry?wsdl" 
in Command line code on line 1 
PHP Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://m2mconnect.orange.co.uk/orange-soap/services/MessageServiceByCountry?wsdl' : 
failed to load external entity "https://m2mconnect.orange.co.uk/orange-soap/services/MessageServiceByCountry?wsdl" 
in Command line code:1 
Stack trace: 
#0 Command line code(1): SoapClient->SoapClient('https://m2mconn...') 
#1 {main} 
    thrown in Command line code on line 1 

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://m2mconnect.orange.co.uk/orange-soap/services/MessageServiceByCountry?wsdl' : 
failed to load external entity "https://m2mconnect.orange.co.uk/orange-soap/services/MessageServiceByCountry?wsdl" 
in Command line code:1 
Stack trace: 
#0 Command line code(1): SoapClient->SoapClient('https://m2mconn...') 
#1 {main} 
    thrown in Command line code on line 1 

Wget'ing的WSDL:

$> wget https://m2mconnect.orange.co.uk/orange-soap/services/MessageServiceByCountry?wsdl -O MSBC.wsdl 
--19:41:45-- https://m2mconnect.orange.co.uk/orange-soap/services/MessageServiceByCountry?wsdl 
      => `MSBC.wsdl' 
Resolving m2mconnect.orange.co.uk... done. 
Connecting to m2mconnect.orange.co.uk[213.52.171.155]:443... connected. 

Unable to establish SSL connection. 

Unable to establish SSL connection. 

下載通過瀏覽器WSDL,並使用一個:

$> php -r "$s = new SoapClient('MSBC2.wsdl');var_dump($s, $s->__getFunctions());" 
object(SoapClient)#1 (2) { 
    ["_soap_version"]=> 
    int(1) 
    ["sdl"]=> 
    resource(6) of type (Unknown) 
} 
array(11) { 
    [0]=> 
    string(133) "int sendMessage(string $username, string $password, string $deviceMSISDN, string $message, boolean $deliveryReport, string $mtBearer)" 
    [1]=> 
    string(116) "ArrayOf_xsd_string getDeliveryReports(string $username, string $password, string $deviceMSISDN, string $countryCode)" 
    [2]=> 
    string(122) "ArrayOf_xsd_string readMessages(string $username, string $password, int $count, string $deviceMsisdn, string $countryCode)" 
    [3]=> 
    string(100) "boolean flushMessages(string $username, string $password, string $deviceMSISDN, string $countryCode)" 
    [4]=> 
    string(139) "ArrayOf_xsd_string waitForMessage(string $username, string $password, int $timeout, string $deviceMSISDN, int $msgref, string $countryCode)" 
    [5]=> 
    string(204) "int sendMessageWithValidityPeriod(string $username, string $password, string $deviceMSISDN, string $message, boolean $deliveryReport, string $mtBearer, string $binarySmsDcs, string $validityDaysHoursMins)" 
    [6]=> 
    string(164) "int sendBinarySmsMessage(string $username, string $password, string $deviceMSISDN, string $message, boolean $deliveryReport, string $mtBearer, string $binarySmsDcs)" 
    [7]=> 
    string(162) "ArrayOf_xsd_string sendAndWait(string $username, string $password, int $timeout, string $deviceMSISDN, string $message, boolean $deliveryReport, string $mtBearer)" 
    [8]=> 
    string(193) "ArrayOf_xsd_string sendBinarySmsAndWait(string $username, string $password, int $timeout, string $deviceMSISDN, string $message, boolean $deliveryReport, string $mtBearer, string $binarySmsDcs)" 
    [9]=> 
    string(122) "ArrayOf_xsd_string peekMessages(string $username, string $password, int $count, string $deviceMsisdn, string $countryCode)" 
    [10]=> 
    string(142) "ArrayOf_xsd_string getDeliveryReportsFromDate(string $username, string $password, string $deviceMSISDN, string $countryCode, string $fromDate)" 
} 

$> 

請注意,我無法調用任何方法,因爲我沒有有效的細節。

+0

現在我有這個錯誤致命錯誤:Uncaught SoapFault異常:[HTTP]錯誤獲取http標頭中 –

1

[WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from ...

假設WSDL和服務在互聯網上訪問實際上,這意味着你的腳本無法連接到遠程Web服務 - 它不能下載的WSDL,它不能調用服務。您需要檢查您的服務器的網絡連接(特別是出站)。您可能需要詢問您的主機,因爲其防火牆/配置可能會阻止出站連接。

相關問題