|
Производительность http-сервиса из расширения | ☑ | ||
|---|---|---|---|---|
|
0
vladimir80
29.03.18
✎
17:51
|
Всем привет! Имеем http-service в расширении. Дергается скриптом php на стороне php. Процесс обращение на первой точке соединения около 15 секунд. Сам запрос данных - около секунды. Если дергать постоянно, то несколько раз может проскочить без инициализации сеанса.
Вот тут http://v8.1c.ru/o7/201604service/index.htm вроде как все красиво описали. Пробуем: [code] public function http_query($method, $postfields = false) { $url = $this->doLink($method, $postfields); $this->process = ($this->process) ? $this->process : curl_init(); curl_setopt($this->process, CURLOPT_URL, $url); curl_setopt($this->process, CURLOPT_HTTPHEADER, array( 'Content-Type'=>'application/json', 'Connection' => 'keep-alive', 'IBSession' => 'start', ) ); curl_setopt($this->process, CURLOPT_HEADER, 0); curl_setopt($this->process, CURLOPT_USERPWD, $this->options['user'] . ":" . $this->options['pass']); curl_setopt($this->process, CURLOPT_TIMEOUT, 30); curl_setopt($this->process, CURLOPT_COOKIEJAR, "/cookie.txt"); curl_setopt($this->process, CURLOPT_COOKIEFILE, "/cookie.txt"); if ($postfields && is_array($postfields)){ curl_setopt($this->process, CURLOPT_POST, 1); curl_setopt($this->process, CURLOPT_POSTFIELDS, json_encode($postfields)); } curl_setopt($this->process, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($this->process, CURLOPT_FOLLOWLOCATION, TRUE); $this->response = curl_exec($this->process); return $this; } [/code] Однако ответы от 1с крайне скупы и не содержат в себе никаких полезных данных: HTTP/1.1 200 OK Date: Thu, 29 Mar 2018 14:42:28 GMT Server: Apache/2.4.25 (Win64) Content-Length: 232861 Content-Type: application/json;charset=utf-8 платформа 8.3.10 Прошу пнуть в нужном направлении. Спасибо. |
|||
|
1
vladimir80
29.03.18
✎
17:52
|
чуть накосячил, в режиме теста
curl_setopt($this->process, CURLOPT_HEADER, 0); конечно же в тру |
|||
|
2
Cyberhawk
29.03.18
✎
18:12
|
База файловая пади
|
|||
|
3
vladimir80
29.03.18
✎
18:19
|
(2) Бади нет канешн.
само нашлось. в пыхе криво отправлял заголовки. |
| Форум | Правила | Описание | Секции | Поиск |