Hi Guys I am trying to make a request and get a response for authenticating my SOAP request.
I tried many different options but this one was the only one which gave me response(even an error 404).
This is my code
$client = new SOAPClient('http://devapi.stellatravelgateway.stellatravelservices.co.uk/DirectoryService.svc?singleWsdl',
array(
'location' => 'http://stellatravelgateway.stellatravelservices.co.uk/DirectoryService/IDirectoryService/Authenticate',
'trace' => 1,
'style' => SOAP_RPC,
'use' => SOAP_ENCODED,
)
);
$request = array(
"BranchCode" => "xxx",
"UserName" => "xxx",
"Password" => "xxx",
"Application" => "xxx",
"Client" => "x",
"BranchID" => 0
);
$result = array();
try {
$result = $client->__soapCall('Authenticate', $request);
} catch (SoapFault $e) {
echo "SOAP Fault: ".$e->getMessage()."<br />
";
}
echo "<pre>";
echo htmlspecialchars($client->__getLastRequestHeaders())."
";
echo htmlspecialchars($client->__getLastRequest())."
";
echo "Response:
".htmlspecialchars($client->__getLastResponseHeaders())."
";
echo htmlspecialchars($client->__getLastResponse())."
";
echo "</pre>";
var_dump($result);
What am i doing wrong? I dont get any response I get thsi
POST /DirectoryService/IDirectoryService/Authenticate HTTP/1.1
Host: stellatravelgateway.stellatravelservices.co.uk
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.5.38
Content-Type: text/xml; charset=utf-8
SOAPAction:"http://stellatravelgateway.stellatravelservices.co.uk/DirectoryService/IDirectoryService/Authenticate"
Content-Length: 367
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://stellatravelgateway.stellatravelservices.co.uk/DirectoryService"><SOAP-ENV:Body><ns1:Authenticate/><param1>xxx</param1><param2>xxx</param2><param3>xxx</param3><param4>x</param4><param5>0</param5></SOAP-ENV:Body></SOAP-ENV:Envelope>
Response:
HTTP/1.1 404 Not Found // Here
Content-Type: text/html
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Mon, 19 Mar 2018 13:34:51 GMT
Connection: close
Content-Length: 1245
This is the exact request I need to 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>
<dir:authenticateRequest BranchCode="xxx" UserName="xxx" Password="xxx" Application="xxx" Client="xxx">
<dir:BranchID>xxx</dir:BranchID>
</dir:authenticateRequest>
</dir:Authenticate>
</soapenv:Body>
</soapenv:Envelope>
EDIT: This is what I get on raw from SoapUI:
POST http://stellatravelgateway.stellatravelservices.co.uk/AirService HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://stellatravelgateway.stellatravelservices.co.uk/DirectoryService/IDirectoryService/Authenticate"
Content-Length: 602
Host: stellatravelgateway.stellatravelservices.co.uk
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
Please guys any help would be great, any feedback! Thank you in advance.