简体   繁体   中英

Uncaught SoapFault

I am getting the following error when trying to create a new SoapClient.

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from ' https://api.mindbodyonline.com/0_5/ClassService.asmx?wsdl ' : failed to load external entity " https://api.mindbodyonline.com/0_5/ClassService.asmx?wsdl " in C:\\xampp\\htdocs\\Work\\Ice\\default\\soaptest.php:8 Stack trace: #0 C:\\xampp\\htdocs\\Work\\Ice\\default\\soaptest.php(8): SoapClient->SoapClient(' https://api.min ...') #1 {main} thrown in C:\\xampp\\htdocs\\Work\\Ice\\default\\soaptest.php on line 8

what would cause the WSDL to not load?

php.ini中启用openssl,然后通过https加载WSDL,这仅在启用openssl模块时有效。

Not sure if this might be the case with you but if you are using the PHP classes provided on the Minbody API on Github, note that they have recently updated them. I had the same problem with classService.php. If you are using classService.php, update the constructor function to the following (same will apply to other services):

function __construct($debug = false)
{
    $endpointUrl = "https://" . GetApiHostname() . "/0_5/ClassService.asmx";
    $wsdlUrl = $endpointUrl . "?wsdl";

    $this->debug = $debug;
    $option = array();
    if ($debug)
        {
            $option = array('trace'=>1);
        }
    $this->client = new soapclient($wsdlUrl, $option);
    $this->client->__setLocation($endpointUrl);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM