-
Notifications
You must be signed in to change notification settings - Fork 3
Alivetest Requests
Dominik Brader edited this page Apr 7, 2019
·
4 revisions
An alivetest is part of the Fallback mechanism. If the alivetest returns alive
, a search request can be sent to FINDOLOGIC. Otherwise the search request should be handled by the shops conventional search. If the returned status code is something else than 200, the shops conventional search should also be used instead of the FINDOLOGIC search.
When sending search or navigation requests, an alivetest is automatically being sent before submitting the actual request. The only thing you need to care about is catching the ServiceNotAliveException
when sending requests.
// ...initialization...
try {
/** @var XmlResponse $xmlResponse */
$xmlResponse = $client->send($searchRequest);
} catch (ServiceNotAliveException $e) { // May be thrown by an unsuccessful alivetest or an invalid response.
// ...call the shop search...
}
// ...initialization...
try {
/** @var XmlResponse $xmlResponse */
$xmlResponse = $client->send($navigationRequest);
} catch (ServiceNotAliveException $e) { // May be thrown by an unsuccessful alivetest or an invalid response.
// ...call the shop search...
}
// ...initialization...
try {
/** @var JsonResponse $xmlResponse */
$xmlResponse = $client->send($suggestRequest);
} catch (ServiceNotAliveException $e) { // May be thrown by an invalid response. Alivetest is not sent for this request type.
// ...call the shop search...
}
Documentation is up to date with version:
Version v1.x