WSDL をローカル ファイルに保存し、それをコンストラクタで参照してみてください...
$client = new SoapClient('/local/path/to/wsdlfile.wsdl');
編集: ファイルシステムの使用中に http エラーが発生する場合は、何か問題があります :-)
これを自分で実行しようとしましたが、これらは私の応答です。注: オレンジ色のサーバーへの接続にも問題がありました。https 接続がやや臭いのかもしれません...
新しい SoapClient を Var ダンプします。
$> 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
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)"
}
$>
有効な詳細がないため、どのメソッドも呼び出すことができないことに注意してください。