Testing Phases
This commit is contained in:
parent
02d1190ac1
commit
cb56855dd5
7
ldbws.php
Normal file
7
ldbws.php
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
require("./php/OpenLDBWS.php");
|
||||||
|
require("/srv/keys/athena/apiKeys.php");
|
||||||
|
$OpenLDBWS = new OpenLDBWS($ldbKey);
|
||||||
|
$response = $OpenLDBWS->GetDepartureBoard(10,"PAD");
|
||||||
|
header("Content-Type: text/plain");
|
||||||
|
print_r($response);
|
139
php/OpenLDBWS.php
Normal file
139
php/OpenLDBWS.php
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
<?php
|
||||||
|
class OpenLDBWS
|
||||||
|
{
|
||||||
|
private $soapClient = NULL;
|
||||||
|
|
||||||
|
private $accessToken;
|
||||||
|
|
||||||
|
private $trace;
|
||||||
|
|
||||||
|
function __construct($accessToken,$trace=FALSE)
|
||||||
|
{
|
||||||
|
$this->accessToken = $accessToken;
|
||||||
|
|
||||||
|
$this->trace = $trace;
|
||||||
|
|
||||||
|
$soapOptions = array("trace"=>$this->trace,"soap_version"=>SOAP_1_2,"features"=>SOAP_SINGLE_ELEMENT_ARRAYS);
|
||||||
|
|
||||||
|
if (extension_loaded("zlib")) $soapOptions["compression"] = SOAP_COMPRESSION_ACCEPT|SOAP_COMPRESSION_GZIP;
|
||||||
|
|
||||||
|
$this->soapClient = new SoapClient("http://lite.realtime.nationalrail.co.uk/OpenLDBWS/wsdl.aspx",$soapOptions);
|
||||||
|
|
||||||
|
$soapVar = new SoapVar(array("ns2:TokenValue"=>$this->accessToken),SOAP_ENC_OBJECT);
|
||||||
|
|
||||||
|
$soapHeader = new SoapHeader("http://thalesgroup.com/RTTI/2010-11-01/ldb/commontypes","AccessToken",$soapVar,FALSE);
|
||||||
|
|
||||||
|
$this->soapClient->__setSoapHeaders($soapHeader);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function call($method,$params)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$response = $this->soapClient->$method($params);
|
||||||
|
}
|
||||||
|
catch(SoapFault $soapFault)
|
||||||
|
{
|
||||||
|
if ($this->trace)
|
||||||
|
{
|
||||||
|
$traceOutput["soapFaultMessage"] = $soapFault->getMessage();
|
||||||
|
|
||||||
|
$traceOutput["soapClientRequest"] = str_replace($this->accessToken,"",$this->soapClient->__getLastRequest());
|
||||||
|
|
||||||
|
$traceOutput["soapClientResponse"] = $this->soapClient->__getLastResponse();
|
||||||
|
|
||||||
|
print_r($traceOutput);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (isset($response)?$response:FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
function StationBoard($method,$numRows,$crs,$filterCrs,$filterType,$timeOffset,$timeWindow)
|
||||||
|
{
|
||||||
|
$params["numRows"] = $numRows;
|
||||||
|
|
||||||
|
$params["crs"] = $crs;
|
||||||
|
|
||||||
|
if ($filterCrs) $params["filterCrs"] = $filterCrs;
|
||||||
|
|
||||||
|
if ($filterType) $params["filterType"] = $filterType;
|
||||||
|
|
||||||
|
if ($timeOffset) $params["timeOffset"] = $timeOffset;
|
||||||
|
|
||||||
|
if ($timeWindow) $params["timeWindow"] = $timeWindow;
|
||||||
|
|
||||||
|
return $this->call($method,$params);
|
||||||
|
}
|
||||||
|
|
||||||
|
function DeparturesBoard($method,$crs,$filterList,$timeOffset,$timeWindow)
|
||||||
|
{
|
||||||
|
$params["crs"] = $crs;
|
||||||
|
|
||||||
|
$params["filterList"] = $filterList;
|
||||||
|
|
||||||
|
if ($timeOffset) $params["timeOffset"] = $timeOffset;
|
||||||
|
|
||||||
|
if ($timeWindow) $params["timeWindow"] = $timeWindow;
|
||||||
|
|
||||||
|
return $this->call($method,$params);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetDepartureBoard($numRows,$crs,$filterCrs="",$filterType="",$timeOffset="",$timeWindow="")
|
||||||
|
{
|
||||||
|
return $this->StationBoard("GetDepartureBoard",$numRows,$crs,$filterCrs,$filterType,$timeOffset,$timeWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetDepBoardWithDetails($numRows,$crs,$filterCrs="",$filterType="",$timeOffset="",$timeWindow="")
|
||||||
|
{
|
||||||
|
return $this->StationBoard("GetDepBoardWithDetails",$numRows,$crs,$filterCrs,$filterType,$timeOffset,$timeWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetArrivalBoard($numRows,$crs,$filterCrs="",$filterType="",$timeOffset="",$timeWindow="")
|
||||||
|
{
|
||||||
|
return $this->StationBoard("GetArrivalBoard",$numRows,$crs,$filterCrs,$filterType,$timeOffset,$timeWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetArrBoardWithDetails($numRows,$crs,$filterCrs="",$filterType="",$timeOffset="",$timeWindow="")
|
||||||
|
{
|
||||||
|
return $this->StationBoard("GetArrBoardWithDetails",$numRows,$crs,$filterCrs,$filterType,$timeOffset,$timeWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetArrivalDepartureBoard($numRows,$crs,$filterCrs="",$filterType="",$timeOffset="",$timeWindow="")
|
||||||
|
{
|
||||||
|
return $this->StationBoard("GetArrivalDepartureBoard",$numRows,$crs,$filterCrs,$filterType,$timeOffset,$timeWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetArrDepBoardWithDetails($numRows,$crs,$filterCrs="",$filterType="",$timeOffset="",$timeWindow="")
|
||||||
|
{
|
||||||
|
return $this->StationBoard("GetArrDepBoardWithDetails",$numRows,$crs,$filterCrs,$filterType,$timeOffset,$timeWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetNextDepartures($crs,$filterList,$timeOffset="",$timeWindow="")
|
||||||
|
{
|
||||||
|
return $this->DeparturesBoard("GetNextDepartures",$crs,$filterList,$timeOffset,$timeWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetNextDeparturesWithDetails($crs,$filterList,$timeOffset="",$timeWindow="")
|
||||||
|
{
|
||||||
|
return $this->DeparturesBoard("GetNextDeparturesWithDetails",$crs,$filterList,$timeOffset,$timeWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetFastestDepartures($crs,$filterList,$timeOffset="",$timeWindow="")
|
||||||
|
{
|
||||||
|
return $this->DeparturesBoard("GetFastestDepartures",$crs,$filterList,$timeOffset,$timeWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetFastestDeparturesWithDetails($crs,$filterList,$timeOffset="",$timeWindow="")
|
||||||
|
{
|
||||||
|
return $this->DeparturesBoard("GetFastestDeparturesWithDetails",$crs,$filterList,$timeOffset,$timeWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetServiceDetails($serviceID)
|
||||||
|
{
|
||||||
|
$params["serviceID"] = $serviceID;
|
||||||
|
|
||||||
|
return $this->call("GetServiceDetails",$params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
341
php/openLDBSVWS_copy.php
Normal file
341
php/openLDBSVWS_copy.php
Normal file
@ -0,0 +1,341 @@
|
|||||||
|
<?php
|
||||||
|
class OpenLDBSVWS
|
||||||
|
{
|
||||||
|
private $accessToken;
|
||||||
|
|
||||||
|
private $trace;
|
||||||
|
|
||||||
|
private $wsdl = '<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<wsdl:definitions
|
||||||
|
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||||
|
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
|
||||||
|
xmlns:sv="http://thalesgroup.com/RTTI/2021-11-01/ldbsv/"
|
||||||
|
targetNamespace="http://thalesgroup.com/RTTI/2021-11-01/ldbsv/">
|
||||||
|
<wsdl:import
|
||||||
|
namespace="http://thalesgroup.com/RTTI/2021-11-01/ldbsv/"
|
||||||
|
location="https://lite.realtime.nationalrail.co.uk/OpenLDBSVWS/wsdl.aspx?refver=2021-11-01"/>
|
||||||
|
<wsdl:service name="ldbsv">
|
||||||
|
<wsdl:port name="LDBSVServiceSoap12" binding="sv:LDBSVServiceSoap12">
|
||||||
|
<soap12:address location="http://lite.realtime.nationalrail.co.uk/OpenLDBSVWS/ldbsv12.asmx"/>
|
||||||
|
</wsdl:port>
|
||||||
|
</wsdl:service>
|
||||||
|
</wsdl:definitions>';
|
||||||
|
|
||||||
|
function __construct($accessToken,$trace=FALSE)
|
||||||
|
{
|
||||||
|
$this->accessToken = $accessToken;
|
||||||
|
|
||||||
|
$this->trace = $trace;
|
||||||
|
|
||||||
|
$soapOptions = array("trace"=>$this->trace,"soap_version"=>SOAP_1_2,"features"=>SOAP_SINGLE_ELEMENT_ARRAYS);
|
||||||
|
|
||||||
|
if (extension_loaded("zlib")) $soapOptions["compression"] = SOAP_COMPRESSION_ACCEPT|SOAP_COMPRESSION_GZIP;
|
||||||
|
|
||||||
|
$this->soapClient = new SoapClient("data:text/plain;base64,".base64_encode($this->wsdl),$soapOptions);
|
||||||
|
|
||||||
|
$soapVar = new SoapVar(array("ns2:TokenValue"=>$this->accessToken),SOAP_ENC_OBJECT);
|
||||||
|
|
||||||
|
$soapHeader = new SoapHeader("http://thalesgroup.com/RTTI/2021-11-01/ldb/commontypes","AccessToken",$soapVar,FALSE);
|
||||||
|
|
||||||
|
$this->soapClient->__setSoapHeaders($soapHeader);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function call($method,$params)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$response = $this->soapClient->$method($params);
|
||||||
|
}
|
||||||
|
catch(SoapFault $soapFault)
|
||||||
|
{
|
||||||
|
if ($this->trace)
|
||||||
|
{
|
||||||
|
$traceOutput["soapFaultMessage"] = $soapFault->getMessage();
|
||||||
|
|
||||||
|
$traceOutput["soapClientRequest"] = str_replace($this->accessToken,"",$this->soapClient->__getLastRequest());
|
||||||
|
|
||||||
|
$traceOutput["soapClientResponse"] = $this->soapClient->__getLastResponse();
|
||||||
|
|
||||||
|
print_r($traceOutput);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (isset($response)?$response:FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetBoardByCRS($method,$numRows,$crs,$time,$timeWindow,$filtercrs,$filterType,$filterTOC,$services,$getNonPassengerServices)
|
||||||
|
{
|
||||||
|
$params = array();
|
||||||
|
|
||||||
|
if ($numRows) $params["numRows"] = $numRows;
|
||||||
|
|
||||||
|
if ($crs) $params["crs"] = $crs;
|
||||||
|
|
||||||
|
if ($time) $params["time"] = $time;
|
||||||
|
|
||||||
|
if ($timeWindow) $params["timeWindow"] = $timeWindow;
|
||||||
|
|
||||||
|
if ($filtercrs) $params["filtercrs"] = $filtercrs;
|
||||||
|
|
||||||
|
if ($filterType) $params["filterType"] = $filterType;
|
||||||
|
|
||||||
|
if ($filterTOC) $params["filterTOC"] = $filterTOC;
|
||||||
|
|
||||||
|
if ($services) $params["services"] = $services;
|
||||||
|
|
||||||
|
if ($getNonPassengerServices) $params["getNonPassengerServices"] = $getNonPassengerServices;
|
||||||
|
|
||||||
|
return $this->call($method,$params);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetArrivalDepartureBoardByCRS($numRows="",$crs="",$time="",$timeWindow="",$filtercrs="",$filterType="",$filterTOC="",$services="",$getNonPassengerServices="")
|
||||||
|
{
|
||||||
|
return $this->GetBoardByCRS("GetArrivalDepartureBoardByCRS",$numRows,$crs,$time,$timeWindow,$filtercrs,$filterType,$filterTOC,$services,$getNonPassengerServices);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetArrivalBoardByCRS($numRows="",$crs="",$time="",$timeWindow="",$filtercrs="",$filterType="",$filterTOC="",$services="",$getNonPassengerServices="")
|
||||||
|
{
|
||||||
|
return $this->GetBoardByCRS("GetArrivalBoardByCRS",$numRows,$crs,$time,$timeWindow,$filtercrs,$filterType,$filterTOC,$services,$getNonPassengerServices);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetDepartureBoardByCRS($numRows="",$crs="",$time="",$timeWindow="",$filtercrs="",$filterType="",$filterTOC="",$services="",$getNonPassengerServices="")
|
||||||
|
{
|
||||||
|
return $this->GetBoardByCRS("GetDepartureBoardByCRS",$numRows,$crs,$time,$timeWindow,$filtercrs,$filterType,$filterTOC,$services,$getNonPassengerServices);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetArrDepBoardWithDetails($numRows="",$crs="",$time="",$timeWindow="",$filtercrs="",$filterType="",$filterTOC="",$services="",$getNonPassengerServices="")
|
||||||
|
{
|
||||||
|
return $this->GetBoardByCRS("GetArrDepBoardWithDetails",$numRows,$crs,$time,$timeWindow,$filtercrs,$filterType,$filterTOC,$services,$getNonPassengerServices);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetArrBoardWithDetails($numRows="",$crs="",$time="",$timeWindow="",$filtercrs="",$filterType="",$filterTOC="",$services="",$getNonPassengerServices="")
|
||||||
|
{
|
||||||
|
return $this->GetBoardByCRS("GetArrBoardWithDetails",$numRows,$crs,$time,$timeWindow,$filtercrs,$filterType,$filterTOC,$services,$getNonPassengerServices);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetDepBoardWithDetails($numRows="",$crs="",$time="",$timeWindow="",$filtercrs="",$filterType="",$filterTOC="",$services="",$getNonPassengerServices="")
|
||||||
|
{
|
||||||
|
return $this->GetBoardByCRS("GetDepBoardWithDetails",$numRows,$crs,$time,$timeWindow,$filtercrs,$filterType,$filterTOC,$services,$getNonPassengerServices);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetBoardByTIPLOC($method,$numRows,$tiploc,$time,$timeWindow,$filterTiploc,$filterType,$filterTOC,$services,$getNonPassengerServices)
|
||||||
|
{
|
||||||
|
$params = array();
|
||||||
|
|
||||||
|
if ($numRows) $params["numRows"] = $numRows;
|
||||||
|
|
||||||
|
if ($tiploc) $params["tiploc"] = $tiploc;
|
||||||
|
|
||||||
|
if ($time) $params["time"] = $time;
|
||||||
|
|
||||||
|
if ($timeWindow) $params["timeWindow"] = $timeWindow;
|
||||||
|
|
||||||
|
if ($filterTiploc) $params["filterTiploc"] = $filterTiploc;
|
||||||
|
|
||||||
|
if ($filterType) $params["filterType"] = $filterType;
|
||||||
|
|
||||||
|
if ($filterTOC) $params["filterTOC"] = $filterTOC;
|
||||||
|
|
||||||
|
if ($services) $params["services"] = $services;
|
||||||
|
|
||||||
|
if ($getNonPassengerServices) $params["getNonPassengerServices"] = $getNonPassengerServices;
|
||||||
|
|
||||||
|
return $this->call($method,$params);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetArrivalDepartureBoardByTIPLOC($numRows="",$tiploc="",$time="",$timeWindow="",$filterTiploc="",$filterType="",$filterTOC="",$services="",$getNonPassengerServices="")
|
||||||
|
{
|
||||||
|
return $this->GetBoardByTIPLOC("GetArrivalDepartureBoardByTIPLOC",$numRows,$tiploc,$time,$timeWindow,$filterTiploc,$filterType,$filterTOC,$services,$getNonPassengerServices);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetArrivalBoardByTIPLOC($numRows="",$tiploc="",$time="",$timeWindow="",$filterTiploc="",$filterType="",$filterTOC="",$services="",$getNonPassengerServices="")
|
||||||
|
{
|
||||||
|
return $this->GetBoardByTIPLOC("GetArrivalBoardByTIPLOC",$numRows,$tiploc,$time,$timeWindow,$filterTiploc,$filterType,$filterTOC,$services,$getNonPassengerServices);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetDepartureBoardByTIPLOC($numRows="",$tiploc="",$time="",$timeWindow="",$filterTiploc="",$filterType="",$filterTOC="",$services="",$getNonPassengerServices="")
|
||||||
|
{
|
||||||
|
return $this->GetBoardByTIPLOC("GetDepartureBoardByTIPLOC",$numRows,$tiploc,$time,$timeWindow,$filterTiploc,$filterType,$filterTOC,$services,$getNonPassengerServices);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetDepartures($method,$crs,$filterList,$time,$timeWindow,$filterTOC,$services)
|
||||||
|
{
|
||||||
|
$params = array();
|
||||||
|
|
||||||
|
if ($crs) $params["crs"] = $crs;
|
||||||
|
|
||||||
|
if ($filterList) $params["filterList"] = $filterList;
|
||||||
|
|
||||||
|
if ($time) $params["time"] = $time;
|
||||||
|
|
||||||
|
if ($timeWindow) $params["timeWindow"] = $timeWindow;
|
||||||
|
|
||||||
|
if ($filterTOC) $params["filterTOC"] = $filterTOC;
|
||||||
|
|
||||||
|
if ($services) $params["services"] = $services;
|
||||||
|
|
||||||
|
return $this->call($method,$params);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetNextDepartures($crs="",$filterList="",$time="",$timeWindow="",$filterTOC="",$services="")
|
||||||
|
{
|
||||||
|
return $this->GetDepartures("GetNextDepartures",$crs,$filterList,$time,$timeWindow,$filterTOC,$services);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetFastestDepartures($crs="",$filterList="",$time="",$timeWindow="",$filterTOC="",$services="")
|
||||||
|
{
|
||||||
|
return $this->GetDepartures("GetFastestDepartures",$crs,$filterList,$time,$timeWindow,$filterTOC,$services);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetNextDeparturesWithDetails($crs="",$filterList="",$time="",$timeWindow="",$filterTOC="",$services="")
|
||||||
|
{
|
||||||
|
return $this->GetDepartures("GetNextDeparturesWithDetails",$crs,$filterList,$time,$timeWindow,$filterTOC,$services);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetFastestDeparturesWithDetails($crs="",$filterList="",$time="",$timeWindow="",$filterTOC="",$services="")
|
||||||
|
{
|
||||||
|
return $this->GetDepartures("GetFastestDeparturesWithDetails",$crs,$filterList,$time,$timeWindow,$filterTOC,$services);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetServiceDetailsByRID($rid="")
|
||||||
|
{
|
||||||
|
$params = array();
|
||||||
|
|
||||||
|
if ($rid) $params["rid"] = $rid;
|
||||||
|
|
||||||
|
return $this->call("GetServiceDetailsByRID",$params);
|
||||||
|
}
|
||||||
|
|
||||||
|
function QueryServices($serviceID="",$sdd="",$filterTime="",$filtercrs="",$tocFilter="")
|
||||||
|
{
|
||||||
|
$params = array();
|
||||||
|
|
||||||
|
if ($serviceID) $params["serviceID"] = $serviceID;
|
||||||
|
|
||||||
|
if ($sdd) $params["sdd"] = $sdd;
|
||||||
|
|
||||||
|
if ($filterTime) $params["filterTime"] = $filterTime;
|
||||||
|
|
||||||
|
if ($filtercrs) $params["filtercrs"] = $filtercrs;
|
||||||
|
|
||||||
|
if ($tocFilter) $params["tocFilter"] = $tocFilter;
|
||||||
|
|
||||||
|
return $this->call("QueryServices",$params);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetDisruptionList($CRSList="")
|
||||||
|
{
|
||||||
|
$params = array();
|
||||||
|
|
||||||
|
if ($CRSList) $params["CRSList"] = $CRSList;
|
||||||
|
|
||||||
|
return $this->call("GetDisruptionList",$params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class OpenLDBSVREFWS
|
||||||
|
{
|
||||||
|
private $accessToken;
|
||||||
|
|
||||||
|
private $trace;
|
||||||
|
|
||||||
|
private $wsdl = '<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<wsdl:definitions
|
||||||
|
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||||
|
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
|
||||||
|
xmlns:sv="http://thalesgroup.com/RTTI/2017-10-01/ldbsv/"
|
||||||
|
targetNamespace="http://thalesgroup.com/RTTI/2017-10-01/ldbsv/">
|
||||||
|
<wsdl:import
|
||||||
|
namespace="http://thalesgroup.com/RTTI/2015-05-14/ldbsv_ref/"
|
||||||
|
location="http://lite.realtime.nationalrail.co.uk/OpenLDBSVWS/rtti_2015-05-14_ldbsv_ref.wsdl"/>
|
||||||
|
<wsdl:service name="ldbsv">
|
||||||
|
<wsdl:port name="LDBSVRefServiceSoap12" binding="ref:LDBSVRefServiceSoap12">
|
||||||
|
<soap12:address location="http://lite.realtime.nationalrail.co.uk/OpenLDBSVWS/ldbsvref.asmx"/>
|
||||||
|
</wsdl:port>
|
||||||
|
</wsdl:service>
|
||||||
|
</wsdl:definitions>';
|
||||||
|
|
||||||
|
function __construct($accessToken,$trace=FALSE)
|
||||||
|
{
|
||||||
|
$this->accessToken = $accessToken;
|
||||||
|
|
||||||
|
$this->trace = $trace;
|
||||||
|
|
||||||
|
$soapOptions = array("trace"=>$this->trace,"soap_version"=>SOAP_1_2,"features"=>SOAP_SINGLE_ELEMENT_ARRAYS);
|
||||||
|
|
||||||
|
if (extension_loaded("zlib")) $soapOptions["compression"] = SOAP_COMPRESSION_ACCEPT|SOAP_COMPRESSION_GZIP;
|
||||||
|
|
||||||
|
$this->soapClient = new SoapClient("data:text/plain;base64,".base64_encode($this->wsdl),$soapOptions);
|
||||||
|
|
||||||
|
$soapVar = new SoapVar(array("ns2:TokenValue"=>$this->accessToken),SOAP_ENC_OBJECT);
|
||||||
|
|
||||||
|
$soapHeader = new SoapHeader("http://thalesgroup.com/RTTI/2010-11-01/ldb/commontypes","AccessToken",$soapVar,FALSE);
|
||||||
|
|
||||||
|
$this->soapClient->__setSoapHeaders($soapHeader);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function call($method,$params)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$response = $this->soapClient->$method($params);
|
||||||
|
}
|
||||||
|
catch(SoapFault $soapFault)
|
||||||
|
{
|
||||||
|
if ($this->trace)
|
||||||
|
{
|
||||||
|
$traceOutput["soapFaultMessage"] = $soapFault->getMessage();
|
||||||
|
|
||||||
|
$traceOutput["soapClientRequest"] = str_replace($this->accessToken,"",$this->soapClient->__getLastRequest());
|
||||||
|
|
||||||
|
$traceOutput["soapClientResponse"] = $this->soapClient->__getLastResponse();
|
||||||
|
|
||||||
|
print_r($traceOutput);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (isset($response)?$response:FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetReasonCode($reasonCode="")
|
||||||
|
{
|
||||||
|
$params = array();
|
||||||
|
|
||||||
|
if ($reasonCode) $params["reasonCode"] = $reasonCode;
|
||||||
|
|
||||||
|
return $this->call("GetReasonCode",$params);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetReasonCodeList()
|
||||||
|
{
|
||||||
|
$params = array();
|
||||||
|
|
||||||
|
return $this->call("GetReasonCodeList",$params);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetSourceInstanceNames()
|
||||||
|
{
|
||||||
|
$params = array();
|
||||||
|
|
||||||
|
return $this->call("GetSourceInstanceNames",$params);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetTOCList($currentVersion="")
|
||||||
|
{
|
||||||
|
$params = array();
|
||||||
|
|
||||||
|
if ($currentVersion) $params["currentVersion"] = $currentVersion;
|
||||||
|
|
||||||
|
return $this->call("GetTOCList",$params);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetStationList($currentVersion="")
|
||||||
|
{
|
||||||
|
$params = array();
|
||||||
|
|
||||||
|
if ($currentVersion) $params["currentVersion"] = $currentVersion;
|
||||||
|
|
||||||
|
return $this->call("GetStationList",$params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
Reference in New Issue
Block a user