I need to make a SOAP request and get a response back, but I have no idea how SOAP works. I tried to search for it and everything is so confusing.
I need to make an authentication request here like this :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dir="http://stellatravelgateway.stellatravelservices.co.uk/DirectoryService">
<soapenv:Header/>
<soapenv:Body>
<dir:Authenticate>
<!-- Optional: -->
<dir:authenticateRequest BranchCode="abcde" UserName="user" Password="password" Application="application" Client="?">
<dir:BranchID>1</dir:BranchID>
</dir:authenticateRequest>
</dir:Authenticate>
</soapenv:Body>
</soapenv:Envelope>
And get an response after that, but have no idea how to do it. I searched and found some similar questions, but can not get any response.
What I am doing is this :
$send = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dir="http://stellatravelgateway.stellatravelservices.co.uk/DirectoryService">
<soapenv:Header/>
<soapenv:Body>
<dir:Authenticate>
<!-- Optional: -->
<dir:authenticateRequest BranchCode="abcde" UserName="user" Password="password" Application="application" Client="?">
<dir:BranchID>1</dir:BranchID>
</dir:authenticateRequest>
</dir:Authenticate>
</soapenv:Body>
</soapenv:Envelope>';
$soapUrl ="http://devapi.stellatravelgateway.stellatravelservices.co.uk/DirectoryService.svc?singleWsdl";
$soapClientVar = new SoapClient("http://devapi.stellatravelgateway.stellatravelservices.co.uk/DirectoryService.svc?singleWsdl");
$resp = $soapClientVar->Authenticate($send);
var_dump($resp);
I know that 99% I totally wrong of what should I do. Can someone please help me understand what exactly should I do and make this SOAP work?
TIA