/** * @param string $messageId * @return string * @throws Exceptions\ArgumentException */ public function getMessageBodyById($messageId) { if ($messageId == null) { throw new Exceptions\ArgumentException("messageId is null"); } if (!is_string($messageId)) { throw new Exceptions\ArgumentException("messageId is not a string"); } $uri = Http\UriBuilder::serviceUri(self::SERVICE_VERSION, self::SERVICE, array($messageId, "body"), $this->httpClient->isSecure()); return $this->loadMessageBody($uri); }
/** * @param string $message * @return Model\ResultItem * @throws Exceptions\EsendexException */ public function getInformation($message, $characterSet = MessageBody::CharsetGSM) { $xml = $this->parser->encode($message, $characterSet); $uri = Http\UriBuilder::serviceUri(self::SERVICE_VERSION, self::SERVICE, null, $this->httpClient->isSecure()); $result = $this->httpClient->post($uri, $this->authentication, $xml); $arr = $this->parser->parse($result); if (count($arr) == 1) { return $arr[0]; } else { throw new Exceptions\EsendexException("Error parsing the result", null, array('data_returned' => $result)); } }