refactor the web services to be cleaner
This commit is contained in:
@@ -45,4 +45,31 @@ class NikarayanService
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SoapFault
|
||||
*/
|
||||
public function getRoadObservedProblemsByDate()
|
||||
{
|
||||
try {
|
||||
$url = "https://riws.rmto.ir/WebServices/NRPTrafficStatus.asmx?wsdl";
|
||||
|
||||
$v = verta();
|
||||
$month = $v->month < 10 ? '0' . $v->month : $v->month;
|
||||
$day = $v->day < 10 ? '0' . $v->day : $v->day;
|
||||
$date = $v->year . $month . $day;
|
||||
|
||||
$soap_client = new SoapClient($url);
|
||||
return $soap_client->Get_RoadObservedProblems_ByDate(array(
|
||||
'strUserName' => 'vaytelrop',
|
||||
'strPassword' => 'VaYtelROP*2024',
|
||||
'strStartDate' => $date,
|
||||
'strEndDate' => $date
|
||||
));
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
Log::channel('nikarayan')->error($e->getMessage());
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user