本文介紹了SOAP 錯誤:解析 WSDL:無法從 <URL> 加載的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
在 PHP 中:我收到一個錯誤:
In PHP: I am getting an error:
SOAP 錯誤:解析 WSDL:無法從 'http://xxx.xxxx.asmx 加載?WSDL' :無法加載外部實體 "http://xxx.xxxx.asmx?WSDL"
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://xxx.xxxx.asmx?WSDL' : failed to load external entity "http://xxx.xxxx.asmx?WSDL"
我的代碼是:
<?php
header('Content-Type: text/plain');
if (!class_exists('SoapClient')) {
die ("You haven't installed the PHP-Soap module.");
}
ini_set('max_execution_time', 1);
try {
$options = array(
'soap_version' => SOAP_1_2,
'exceptions' => true,
'trace' => 1,
'cache_wsdl' => WSDL_CACHE_NONE
);
$client = new SoapClient('http://xxx.xxxx.asmx?WSDL', $options);
// Note where 'CreateIncident' and 'request' tags are in the XML
$results = $client->CreateIncident(
array(
'FirstName' => 'gyaan',
'LastName' => 'p',
'Email' => 'aa@gmail.com',
'QueryProductClass' => 'QueryProductClass',
'ChannelCode' => 12,
'CampaignCode' => 234,
'Lob' => 'Lob',
'PackageName' => 'SEONI',
'PackageCode' => 'SMP',
'TravelYear' => 2012,
'TravelMonth' => 06,
'TravelDay' => 29,
'CityOfResidence' => 'Jabalpur',
'ncidentNotes' => 'testing ignor this',
'MobilePhone' => '1234567890',
'DepartureCity' => 'bangalore',
'NoOfDaysTravel' => '3 Days',
'VendorName' => 'TEST HIQ'
)
);
}
catch (Exception $e) {
echo "<h2>Exception Error!</h2>";
echo $e->getMessage();
}
?>
請告訴我哪里出錯了我是 WSDL 和肥皂的新手
Please tell me where i am making mistake i am new in WSDL and soap
推薦答案
我通過啟用 php_openssl
擴展在我的 WAMP 設置中解決了這個問題,因為我從使用的 https 加載的 URL://
.
I solved this on my WAMP setup by enabling the php_openssl
extension, since the URL I was loading from used https://
.
這篇關于SOAP 錯誤:解析 WSDL:無法從 <URL> 加載的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!