SOAP PHP fault parsing WSDL: failed to load external entity? SOAP PHP fault parsing WSDL: failed to load external entity? php php

SOAP PHP fault parsing WSDL: failed to load external entity?


Security issue: This answer disables security features and should not be used in production!

After migrating to PHP 5.6.5, the soap 1.2 did not work anymore. So I solved the problem by adding optional SSL parameters.

My error:

failed to load external entity

How to solve:

// options for ssl in php 5.6.5$opts = array(    'ssl' => array(        'ciphers' => 'RC4-SHA',        'verify_peer' => false,        'verify_peer_name' => false    ));// SOAP 1.2 client$params = array(    'encoding' => 'UTF-8',    'verifypeer' => false,    'verifyhost' => false,    'soap_version' => SOAP_1_2,    'trace' => 1,    'exceptions' => 1,    'connection_timeout' => 180,    'stream_context' => stream_context_create($opts));$wsdlUrl = $url . '?WSDL';$oSoapClient = new SoapClient($wsdlUrl, $params);


Put this code above any Soap call:

libxml_disable_entity_loader(false);


Security issue: This answer disables security features and should not be used in production!

try this. works for me

$options = array(    'cache_wsdl' => 0,    'trace' => 1,    'stream_context' => stream_context_create(array(          'ssl' => array(               'verify_peer' => false,                'verify_peer_name' => false,                'allow_self_signed' => true          )    ));$client = new SoapClient(url, $options);