I have wsld url. I have to add custom http request header to authorize for this wsdl. When I try soapclient as following , I get error.
/* userName and password is masked in this question */
$opts = array(
'http'=>array(
"userName:xxxxx
".
"password:xxxxxx
"
)
);
$streamContext = stream_context_create($opts);
$cilent = new SoapClient("https://iflyrestest.ibsgen.com:6013/iRes_Booking_WS/services/AvailabilityPort?wsdl" , array('stream_context' => $streamContext));
Error:
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't find <definitions> in
Because response is like 'You are not authorized to access this URL...'
Also When I try function 'file_get_content()' with same stream_context, I successfully get content of this url.
How should I use soapclient for this case ?