refactor the web services to be cleaner

This commit is contained in:
2025-03-09 13:41:00 +03:30
parent 5f2cbf5f12
commit 905cacbd3b
5 changed files with 2697 additions and 2718 deletions

View File

@@ -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;
}
}
}