/** * @param TelnetResponseInterface $telnetResponse * * @return \Graze\Dynamark3Client\Dynamark3ResponseInterface */ public function parseResponse(TelnetResponseInterface $telnetResponse) { $promptMatches = $telnetResponse->getPromptMatches(); $prompt = reset($promptMatches); $response = parent::parseResponse($telnetResponse); // prompt = RESULT GETXML <xml><something... $response->setResponseText(substr($prompt, 14)); return $response; }
/** * @param TelnetResponseInterface $response * * @return \Graze\Dynamark3Client\Dynamark3ResponseInterface */ public function parseResponse(TelnetResponseInterface $response) { $errorCode = null; $promptMatches = $response->getPromptMatches(); $prompt = reset($promptMatches); if ($response->isError()) { // error prompt - ERROR nnn $errorCode = substr($prompt, 6); } return new Dynamark3Response($prompt, $errorCode); }