I am still very new to use php to call the SoapClient. Recently I have a project which I need to call the API from .net using web service SOAP.
I won't able to see the actual XML code of the web service URL provided as it requires header to access, therefore test via POSTMAN, it works well.
However, it doesn't work when using php to call their web service on the localhost server (XAMPP), (other web service address work fine on the code below), not sure where it goes wrong:
$Auth = array(
'Content-Type' => 'text/xml',
'X-RW-Auth-Token' => '4f931e62-d8c8-439b-a4d7-0c29fc0e3dbe'
);
$client = new SoapClient("https://licensed-ws.ricewarnerdigital.com/process/RiskEngine/v1.0/EndPoint.asmx?wsdl");
$header = new SoapHeader(url,null, $Auth,false);
$client->__setSoapHeaders($header);
$param = array(
'RR_AgeNext' => '30',
'RR_TermSI' => '1000000',
'RR_TPDSI' => '3000000',
'RR_AnyOwn' => 'A'
);
$GetResponse = $client->GetQuotationsForParameters($param);
Error:
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from '...' : failed to load external entity "..." in /Applications/XAMPP/xamppfiles/htdocs/quote-tool/ricewarner_api.php:11 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/quote-tool/ricewarner_api.php(11): SoapClient->SoapClient('https://license...') #1 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/quote-tool/ricewarner_api.php on line 11
<soapenv:Header>tag. I'm afraid without this, we cannot help you.