tokenProvider->getToken(); $requestPayload = [[ 'JetonAuthentification' => $token, 'Exploitation' => [ 'CodePays' => $this->exploitationCountryCode, 'NumeroExploitation' => $this->exploitationNumber, ], 'Bovin' => [ 'CodePays' => $countryCode, 'NumeroNational' => $nationalNumber, ], ]]; try { /** @var object $soapResponse */ $soapResponse = $this->businessClient->__soapCall('IpBGetDossierAnimal', $requestPayload); } catch (SoapFault $soapFault) { throw new RuntimeException('SOAP Fault on IpBGetDossierAnimal: '.$soapFault->getMessage(), 0, $soapFault); } // Throw uniquement si Resultat=false (erreur métier) $standardResponseNode = $soapResponse->ReponseStandard ?? null; $isOk = is_object($standardResponseNode) && (($standardResponseNode->Resultat ?? false) === true); if (!$isOk) { $anomalyNode = is_object($standardResponseNode) ? ($standardResponseNode->Anomalie ?? null) : null; throw new EdnotifException( codeAnomalie: (string) ($anomalyNode->Code ?? 'UNKNOWN'), severite: (int) ($anomalyNode->Severite ?? 1), message: (string) ($anomalyNode->Message ?? 'EDNOTIF error') ); } return $this->bovinDossierMapper->map($soapResponse); } }