gpt4 book ai didi

php - SOAP 错误 : Parsing WSDL: Couldn't load from

转载 作者:IT王子 更新时间:2023-10-29 00:14:27 27 4
gpt4 key购买 nike

在 PHP 中:我遇到错误:

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 和 soap 的新手

最佳答案

我通过启用 php_openssl 扩展在我的 WAMP 设置中解决了这个问题,因为我从中加载的 URL 使用了 https://

关于php - SOAP 错误 : Parsing WSDL: Couldn't load from <URL>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11082889/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com