173 if(mb_strtolower(SITE_CHARSET) !=
'utf-8')
174 $requestData = Encoding::convertEncoding($requestData, SITE_CHARSET,
'UTF-8');
176 $httpRes = $this->httpClient->post(self::$url, $requestData);
177 $errors = $this->httpClient->getError();
179 if (!$httpRes && !empty($errors))
183 foreach($errors as $errorCode => $errMes)
184 $strError .= $errorCode.
": ".$errMes;
186 $result->addError(
new Error($strError));
190 $status = $this->httpClient->getStatus();
192 if(mb_strtolower(SITE_CHARSET) !=
'utf-8')
193 $httpRes = Encoding::convertEncoding($httpRes,
'UTF-8', SITE_CHARSET);
195 $objXML = new \CDataXML();
196 $objXML->LoadString($httpRes);
197 $data = $objXML->GetArray();
198 $result->addData($data);
202 $result->addError(
new Error(
Loc::getMessage(
'SALE_DELIVERY_TRACKING_RUS_POST_ERROR_HTTP_STATUS').
': '.$status));
204 if(!empty($data[
'Envelope'][
'#'][
'Body'][0][
'#'][
'Fault'][0][
'#'][
'Reason'][0][
'#'][
'Text'][0][
'#']))
205 $result->addError(
new Error($data[
'Envelope'][
'#'][
'Body'][0][
'#'][
'Fault'][0][
'#'][
'Reason'][0][
'#'][
'Text'][0][
'#']));
207 if(!empty($data[
'Envelope'][
'#'][
'Body'][0][
'#'][
'Fault'][0][
'#'][
'Detail'][0][
'#'][
'AuthorizationFaultReason'][0][
'#']))
208 $result->addError(
new Error($data[
'Envelope'][
'#'][
'Body'][0][
'#'][
'Fault'][0][
'#'][
'Detail'][0][
'#'][
'AuthorizationFaultReason'][0][
'#']));
223 <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:oper="http://russianpost.org/operationhistory" xmlns:data="http://russianpost.org/operationhistory/data" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
226 <oper:getOperationHistory>
227 <data:OperationHistoryRequest>
228 <data:Barcode>'.$trackingNumber.
'</data:Barcode>
229 <data:MessageType>0</data:MessageType>
230 <data:Language>'.$this->lang.
'</data:Language>
231 </data:OperationHistoryRequest>
232 <data:AuthorizationHeader soapenv:mustUnderstand="1">
233 <data:login>'.$this->login.
'</data:login>
234 <data:password>'.$this->password.
'</data:password>
235 </data:AuthorizationHeader>
236 </oper:getOperationHistory>
243 if(!$res->isSuccess())
245 $result->addErrors($res->getErrors());
261 if($lastOperationTS > 0)
264 $result->trackingNumber = $trackingNumber;