SOAP 错误:解析 WSDL:无法从 <URL> 加载

SOAP-ERROR: Parsing WSDL: Couldn#39;t load from lt;URLgt;(SOAP 错误:解析 WSDL:无法从 lt;URLgt; 加载)
本文介绍了SOAP 错误:解析 WSDL:无法从 <URL> 加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

在 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:无法从 &lt;URL&gt; 加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Subtract time in PHP(在 PHP 中减去时间)
Limit execution time of an function or command PHP(限制函数或命令 PHP 的执行时间)
How to sum N number of time (HH:MM Format)?(如何求和 N 次(HH:MM 格式)?)
How to get current time in milliseconds in PHP?(如何在 PHP 中以毫秒为单位获取当前时间?)
How to check if time is between two times in PHP(如何检查时间是否在 PHP 中的两次之间)
Convert number of minutes into hours amp; minutes using PHP(将分钟数转换为小时数分钟使用 PHP)