<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope" xmlns:ns2="https://int44.zakupki.gov.ru/eis-integration/services/getDocsMis2">
<soapenv:Header/>
<soapenv:Body>
<ns2:getPublicDocsRequest>
<index>
<id>25aa7b1a-8ab2-4838-86b2-65f5e8127cc8</id>
<sender>test_001</sender>
<createDateTime>2024-01-17T09:30:47Z</createDateTime>
<mode>PROD</mode>
</index>
<selectionParams44>
<subsystemType>PRIZ</subsystemType>
<periodInfo>
<exactDate>2024-03-14</exactDate>
</periodInfo>
<organizations44Info>
<organization44Info>
<regNum>123456789012</regNum>
</organization44Info>
</organizations44Info>
</selectionParams44>
</ns2:getPublicDocsRequest>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://zakupki.gov.ru/fz44/get-docs-le/ws">
<soapenv:Header/>
<soapenv:Body>
<ws:getNsiRequest>
<index>
<id>{{$guid}}</id>
<createDateTime>{{$isoTimestamp}}</createDateTime>
<mode>PROD</mode>
</index>
<selectionParams>
<nsiCode44>nsiAllList</nsiCode44>
<nsiKind>all</nsiKind>
</selectionParams>
</ws:getNsiRequest>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://zakupki.gov.ru/fz44/get-docs-le/ws">
<soapenv:Header/>
<soapenv:Body>
<ws:getDocsByReestrNumberRequest>
<index>
<id>32c8b412-bbd7-4264-8a72-3a9bad9bc167</id>
<createDateTime>2024-10-24T11:29:22.980+03:00</createDateTime>
<mode>PROD</mode>
</index>
<selectionParams>
<subsystemType>PRIZ</subsystemType>
<reestrNumber>0847500000924001515</reestrNumber>
</selectionParams>
</ws:getDocsByReestrNumberRequest>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://zakupki.gov.ru/fz44/get-docs-le/ws">
<soapenv:Header/>
<soapenv:Body>
<ws:getDocsByOrgRegionRequest>
<index>
<id>89cfbbaf-1951-423e-b455-70d433c66123</id>
<createDateTime>2024-11-22T12:36:00.084Z</createDateTime>
<mode>PROD</mode>
</index>
<selectionParams>
<orgRegion>50</orgRegion>
<subsystemType>UR</subsystemType>
<documentType44>contractProcedureUnilateralRefusal</documentType44>
<periodInfo>
<exactDate>2024-11-22</exactDate>
</periodInfo>
</selectionParams>
</ws:getDocsByOrgRegionRequest>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://zakupki.gov.ru/fz44/get-docs-le/ws">
<soapenv:Header/>
<soapenv:Body>
<ws:getDocsByOrgRegionRequest>
<index>
<id>32c8b412-baa7-4264-8a72-3a9bad9bc167</id>
<createDateTime>2024-10-25T16:37:22.980Z</createDateTime>
<mode>PROD</mode>
</index>
<selectionParams>
<orgRegion>49</orgRegion>
<subsystemType>PRIZ</subsystemType>
<documentType44>epNotificationEZK2020</documentType44>
<periodInfo>
<exactDate>2024-10-17+03:00</exactDate>
</periodInfo>
</selectionParams>
</ws:getDocsByOrgRegionRequest>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://zakupki.gov.ru/fz44/get-docs-le/ws">
<soapenv:Header/>
<soapenv:Body>
<ws:getDocsByOrgRegionRequest>
<index>
<id>{-Variable.gUID-}</id>
<createDateTime>{-Variable.dATE-}</createDateTime>
<mode>PROD</mode>
</index>
<selectionParams>
<orgRegion>77</orgRegion>
<subsystemType>UR</subsystemType>
<exactDate>2024-11-21+03:00<</exactDate>
</selectionParams>
</ws:getDocsByOrgRegionRequest>
</soapenv:Body>
</soapenv:Envelope>
33c8b413-bbd9-4264-8a72-3a9bad9ac187
2024-12-04T11:12:22.980+03:00
PROD
RPZ223
2240778154
. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://zakupki.gov.ru/fz44/get-docs-le/ws">
<soapenv:Header/>
<soapenv:Body>
<ws:getDocsByReestrNumberRequest>
<index>
<id>33c8b413-bbd9-4264-8a72-3a9bad9ac187</id>
<createDateTime>2024-12-04T11:12:22.980+03:00</createDateTime>
<mode>PROD</mode>
</index>
<selectionParams>
<subsystemType>RPZ223</subsystemType>
<reestrNumber>2240778154</reestrNumber>
</selectionParams>
</ws:getDocsByReestrNumberRequest>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://zakupki.gov.ru/fz44/get-docs-le/ws">
<soapenv:Header/>
<soapenv:Body>
<ws:getDocsByOrgRegionRequest>
<index>
<id>32c8b412-baa7-5264-8a74-3a9bad9bc167</id>
<createDateTime>2024-12-04T14:38:22.980Z</createDateTime>
<mode>PROD</mode>
</index>
<selectionParams>
<orgRegion>50</orgRegion>
<subsystemType>RPZ223</subsystemType>
<documentType223>purchasePlan</documentType223>
<periodInfo>
<exactDate>2024-10-17+03:00</exactDate>
</periodInfo>
</selectionParams>
</ws:getDocsByOrgRegionRequest>
</soapenv:Body>
</soapenv:Envelope>
<ws:getDocsByOrgRegionRequest>
<index>
<id>{{$guid}}</id>
<createDateTime>{{$isoTimestamp}}</createDateTime>
<mode>PROD</mode>
</index>
<selectionParams>
<orgRegion>77</orgRegion>
<subsystemType>RNP</subsystemType>
<documentType44>unfairSupplier2022</documentType44>
<periodInfo>
<exactDate>2024-12-18</exactDate>
</periodInfo>
</selectionParams>
</ws:getDocsByOrgRegionRequest>
<selectionParams>
<orgRegion>77</orgRegion>
<subsystemType>RNP</subsystemType>
<documentType44>unfairSupplier2022</documentType44>
<periodInfo>
<exactDate>2025-01-20</exactDate>
</periodInfo>
</selectionParams>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://zakupki.gov.ru/fz44/get-docs-ip/ws">
<soapenv:Header>
<individualPerson_token>{{ token }}</individualPerson_token>
</soapenv:Header>
<soapenv:Body>
<ws:getDocsByReestrNumberRequest>
<index>
<id>{{ UUID }}</id>
<createDateTime>{{ created_time }}</createDateTime>
<mode>PROD</mode>
</index>
<selectionParams>
<subsystemType>RNP</subsystemType>
<reestrNumber>24015080</reestrNumber>
</selectionParams>
</ws:getDocsByReestrNumberRequest>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://zakupki.gov.ru/fz44/get-docs-ip/ws">
<soapenv:Header>
<individualPerson_token>{{ token }}</individualPerson_token>
</soapenv:Header>
<soapenv:Body>
<ws:getDocsByOrgRegionRequest>
<index>
<id>{{ UUID }}</id>
<createDateTime>{{ created_time }}</createDateTime>
<mode>PROD</mode>
</index>
<selectionParams>
<orgRegion>77</orgRegion>
<subsystemType>RI223</subsystemType>
<documentType44>purchaseNotice</documentType44>
<periodInfo>
<exactDate>2024-12-24</exactDate>
</periodInfo>
</selectionParams>
</ws:getDocsByOrgRegionRequest>
</soapenv:Body>
</soapenv:Envelope>
import requests
import os
import uuid
from datetime import datetime
service_url = "https://int44.zakupki.gov.ru/eis-integration/services/getDocsLE2"
token = "ваш_токен"
save_path = r"путь для сохранения архива"
#SOAP-запрос
soap_request_template = """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://zakupki.gov.ru/fz44/get-docs-le/ws">
<soapenv:Header>
<token>{token}</token>
</soapenv:Header>
<soapenv:Body>
<ws:getDocsByOrgRegionRequest>
<index>
<id>{request_id}</id>
<createDateTime>{create_date}</createDateTime>
<mode>PROD</mode>
</index>
<selectionParams>
<orgRegion>38</orgRegion>
<subsystemType>PRIZ</subsystemType>
<documentType44>epNotificationEZK2020</documentType44>
<periodInfo>
<exactDate>2024-11-28</exactDate>
</periodInfo>
</selectionParams>
</ws:getDocsByOrgRegionRequest>
</soapenv:Body>
</soapenv:Envelope>"""
# Функция для создания запроса
def create_soap_request():
request_id = str(uuid.uuid4())
create_date = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')
return soap_request_template.format(token=token, request_id=request_id, create_date=create_date)
# Функция для отправки SOAP-запроса
def send_soap_request():
headers = {
"Content-Type": "text/xml; charset=utf-8",
}
data = create_soap_request()
response = requests.post(service_url, headers=headers, data=data, verify=False)
response.raise_for_status()
return response.text
# Функция для загрузки архива
def download_archive(archive_url, archive_name):
headers = {
"User-Agent": "Mozilla/5.0"
}
try:
with requests.Session() as session:
response = session.get(archive_url, headers=headers, stream=True, verify=False)
response.raise_for_status()
# Сохраняем файл
file_path = os.path.join(save_path, archive_name)
with open(file_path, "wb") as file:
for chunk in response.iter_content(chunk_size=8192):
file.write(chunk)
print(f"Архив скачан: {file_path}")
except requests.exceptions.HTTPError as http_err:
print(f"HTTP ошибка при загрузке: {http_err}")
except Exception as err:
print(f"Ошибка при загрузке архива: {err}")
# Исполнение
def main():
try:
print("Отправляем запрос к серверу для формирования архива...")
response = send_soap_request()
print("Ответ сервера:")
print(response)
if "<archiveUrl>" in response:
archive_url_start = response.find("<archiveUrl>") + len("<archiveUrl>")
archive_url_end = response.find("</archiveUrl>")
archive_url = response[archive_url_start:archive_url_end]
print(f"Ссылка на архив: {archive_url}")
# Извлекаем данные для имени файла
id_start = response.find("<id>") + len("<id>")
id_end = response.find("</id>")
archive_id = response[id_start:id_end]
date_start = response.find("<createDateTime>") + len("<createDateTime>")
date_end = response.find("</createDateTime>")
create_date = response[date_start:date_end].replace(":", "-")
archive_name = f"epNotificationEZK2020_{create_date}_{archive_id}.zip"
print("Загрузка архива...")
if not os.path.exists(save_path):
os.makedirs(save_path)
download_archive(archive_url, archive_name)
else:
print("Ссылка отсутствует")
except Exception as e:
print(f"Произошла ошибка: {e}")
if __name__ == "__main__":
main()
curl --data-binary C:\Stunnel\1.xml -X POST http://localhost:8080/eisintegration/services/getDocsLE
ocsLE2
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>
...могу написать что делал.
debug = 7
cert = (Путь к сертификату с расширением .cer)
output = (путь к файлу лога stunnel)
client = yes
[https]
accept = 127.0.0.1:8080
connect = int44.zakupki.gov.ru:443
http://127.0.0.1:8080/eis-integration/services/getDocsLE
http://[Имя моего сервера]:8080/eis-integration/services/getDocsLE
меняем с этого: https://int44.zakupki.gov.ru/dstore/le/download/NSI/file.zip?ticket=...
На это http://[Имя моего сервера]:8080/dstore/le/download/NSI/file.zip?ticket=...
https://int44.zakupki.gov.ru/dstore/le/download/PRIZ/file.zip?ticket=YNUF0KTvcnklzIgKijoA8ybbwZQntj5NiNppg68BCVV3swf0FsAUYjBVmtK1w4TwsE32xMFGznBwVRUaGLZsWuui6wUbv0qoKzRM9zjN3Jhhl%2FrDNovMFG1Xdsgb9E30a3fnBRfLMLfwDH%2B%2F8IVP9n3TAxEW1Msu4SACrdOo2ws5Rz1X7h8BRTxG%2BJ8rB1ddArfXjzpAxJ7JVp59ccGTViIJtQAh62HPUyB3vW3hqEqqpQnvYUN7YM747ilSmR0G0Nppi....
но, и в браузере с сертом и get запросом возвращается 500 ошибка, у Вас всё хорошо открывается? Сергей Егоров может у Вас что то подобное было? 28
Ошибка валидации полученного запроса по интеграционной схеме. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://zakupki.gov.ru/fz44/get-docs-le/ws">
<soapenv:Header/>
<soapenv:Body>
<n1:getDocsByReestrNumberRequest>
<index>
<id>${=java.util.UUID.randomUUID()}</id>
<createDateTime>${=java.time.format.DateTimeFormatter.ISO_INSTANT.format(java.time.Instant.now())}</createDateTime>
<mode>PROD</mode>
</index>
<selectionParams>
<subsystemType>PRIZ</subsystemType>
<reestrNumber>0888200000224000038</reestrNumber>
</selectionParams>
</n1:getDocsByReestrNumberRequest>
</soapenv:Body>
</soapenv:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header/>
<soap:Body>
<ns2:getNsiResponse xmlns:ns2="http://zakupki.gov.ru/fz44/get-docs-le/ws">
<index>
<id>6fe43d08-71d1-43dc-87d7-a35f09b52c3e</id>
<refId/>
<createDateTime>2025-01-16T17:59:48.746</createDateTime>
</index>
<dataInfo>
<errorInfo>
<code>0</code>
<message>Непредвиденная ошибка в ходе обработки запроса</message>
</errorInfo>
</dataInfo>
</ns2:getNsiResponse>
</soap:Body>
</soap:Envelope>
import requests
import os
import uuid
import time
from datetime import datetime, timedelta
import random
import string
# Данные для работы
service_url = "https://int44.zakupki.gov.ru/eis-integration/services/getDocsIP"
token = "твой токен"
# Путь для сохранения архива
save_path = r"C:\\Users\\123\\Desktop\\data"
# XML-шаблон SOAP-запроса
soap_request_template = """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://zakupki.gov.ru/fz44/get-docs-ip/ws">
<soapenv:Header>
<individualPerson_token>{token}</individualPerson_token>
</soapenv:Header>
<soapenv:Body>
<ws:getDocsByOrgRegionRequest>
<index>
<id>{request_id}</id>
<createDateTime>{create_date}</createDateTime>
<mode>PROD</mode>
</index>
<selectionParams>
<orgRegion>{region}</orgRegion>
<subsystemType>{subsystem_type}</subsystemType>
<documentType44>{document_type}</documentType44>
<periodInfo>
<exactDate>{exact_date}</exactDate>
</periodInfo>
</selectionParams>
</ws:getDocsByOrgRegionRequest>
</soapenv:Body>
</soapenv:Envelope>"""
# Функция создания SOAP-запроса
def create_soap_request(region, subsystem_type, document_type, exact_date):
request_id = str(uuid.uuid4())
create_date = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')
return soap_request_template.format(token=token, request_id=request_id, create_date=create_date,
region=region, subsystem_type=subsystem_type,
document_type=document_type, exact_date=exact_date)
# Функция отправки SOAP-запроса
def send_soap_request(region, subsystem_type, document_type, exact_date, retries=3, delay=10):
headers = {"Content-Type": "text/xml; charset=utf-8"}
data = create_soap_request(region, subsystem_type, document_type, exact_date)
for attempt in range(retries):
try:
print(f"[DEBUG] Попытка {attempt + 1}: отправка SOAP-запроса...")
response = requests.post(service_url, headers=headers, data=data, verify=False)
response.raise_for_status()
return response.text
except Exception as e:
print(f"[WARNING] Ошибка: {e}. Повторная попытка через {delay} сек...")
time.sleep(delay)
return ""
# Функция для генерации 5-символьного уникального постфикса
def generate_unique_suffix(length=5):
return ''.join(random.choices(string.ascii_letters + string.digits, k=length))
# Функция скачивания архивов по всем ссылкам
def download_archives(response, region_code, subsystem, document_type, exact_date, token):
archive_urls = []
start_idx = 0
# Извлечение всех ссылок на архивы из ответа
while "<archiveUrl>" in response[start_idx:]:
start_idx = response.find("<archiveUrl>", start_idx) + len("<archiveUrl>")
end_idx = response.find("</archiveUrl>", start_idx)
archive_urls.append(response[start_idx:end_idx])
if not archive_urls:
print("[INFO] Ссылки на архивы отсутствуют в ответе.")
return
print(f"[INFO] Найдено {len(archive_urls)} ссылок на архивы.")
failed_downloads = []
for idx, archive_url in enumerate(archive_urls, start=1):
unique_suffix = generate_unique_suffix() # Генерация уникального постфикса
archive_name = f"{region_code}_{subsystem}_{document_type}_{exact_date}_part{idx}_{unique_suffix}.zip"
print(f"[INFO] Скачиваем архив #{idx}: {archive_url}")
success = download_archive(archive_url, archive_name, token)
if not success:
failed_downloads.append((archive_url, archive_name))
# Повторные попытки скачивания
if failed_downloads:
print(f"[INFO] Повторная попытка скачивания {len(failed_downloads)} архивов...")
for archive_url, archive_name in failed_downloads:
print(f"[INFO] Повторно скачиваем: {archive_name}")
download_archive(archive_url, archive_name, token)
# Функция скачивания архива
def download_archive(archive_url, archive_name, token):
headers = {"individualPerson_token": token}
file_path = os.path.join(save_path, archive_name)
os.makedirs(save_path, exist_ok=True) # Создаём папку, если её нет
print("[INFO] Ждём 5 секунд перед скачиванием...")
time.sleep(5)
try:
response = requests.get(archive_url, headers=headers, stream=True, verify=False, timeout=60)
response.raise_for_status()
save_file(response, file_path)
print(f"[SUCCESS] Архив успешно скачан: {file_path}")
return True
except Exception as e:
print(f"[ERROR] Ошибка при скачивании: {e}")
return False
# Сохранение файла
def save_file(response, file_path):
with open(file_path, "wb") as file:
for chunk in response.iter_content(chunk_size=8192):
file.write(chunk)
# Основной процесс
def main():
subsystem_types = ["RGK"]
document_types = ["contract"]
# Диапазон дат для обработки
start_date = datetime(2025, 1, 1)
end_date = datetime(2025, 1, 16)
date_range = [(start_date + timedelta(days=i)).strftime('%Y-%m-%d') for i in range((end_date - start_date).days + 1)]
regions = {"01": "Адыгея Республика",
"02": "Башкортостан Республика",
"03": "Бурятия Республика",
"04": "Алтай Республика",
"05": "Дагестан Республика",
"06": "Ингушетия Республика",
"07": "Кабардино-Балкарская Республика",
"08": "Калмыкия Республика",
"09": "Карачаево-Черкесская Республика",
"10": "Карелия Республика",
"11": "Коми Республика",
"12": "Марий Эл Республика",
"13": "Мордовия Республика",
"14": "Саха (Якутия) Республика",
"15": "Северная Осетия - Алания Республика",
"16": "Татарстан Республика",
"17": "Тыва Республика",
"18": "Удмуртская Республика",
"19": "Хакасия Республика",
"20": "Чеченская Республика",
"21": "Чувашская Республика - Чувашия",
"22": "Алтайский Край",
"23": "Краснодарский Край",
"24": "Красноярский Край",
"25": "Приморский Край",
"26": "Ставропольский Край",
"27": "Хабаровский Край",
"28": "Амурская Область",
"29": "Архангельская Область",
"30": "Астраханская Область",
"31": "Белгородская Область",
"32": "Брянская Область",
"33": "Владимирская Область",
"34": "Волгоградская Область",
"35": "Вологодская Область",
"36": "Воронежская Область",
"37": "Ивановская Область",
"38": "Иркутская Область",
"39": "Калининградская Область",
"40": "Калужская Область",
"41": "Камчатский Край",
"42": "Кемеровская область - Кузбасс Область",
"43": "Кировская Область",
"44": "Костромская Область",
"45": "Курганская Область",
"46": "Курская Область",
"47": "Ленинградская Область",
"48": "Липецкая Область",
"49": "Магаданская Область",
"50": "Московская Область",
"51": "Мурманская Область",
"52": "Нижегородская Область",
"53": "Новгородская Область",
"54": "Новосибирская Область",
"55": "Омская Область",
"56": "Оренбургская Область",
"57": "Орловская Область",
"58": "Пензенская Область",
"59": "Пермский Край",
"60": "Псковская Область",
"61": "Ростовская Область",
"62": "Рязанская Область",
"63": "Самарская Область",
"64": "Саратовская Область",
"65": "Сахалинская Область",
"66": "Свердловская Область",
"67": "Смоленская Область",
"68": "Тамбовская Область",
"69": "Тверская Область",
"70": "Томская Область",
"71": "Тульская Область",
"72": "Тюменская Область",
"73": "Ульяновская Область",
"74": "Челябинская Область",
"75": "Забайкальский Край",
"76": "Ярославская Область",
"77": "Москва Город",
"78": "Санкт-Петербург Город",
"79": "Еврейская Автономная область",
"83": "Ненецкий Автономный округ",
"86": "Ханты-Мансийский Автономный округ - Югра Автономный округ",
"87": "Чукотский Автономный округ",
"89": "Ямало-Ненецкий Автономный округ",
"90": "Запорожская Область",
"91": "Крым Республика",
"92": "Севастополь Город",
"93": "Донецкая Народная Республика",
"94": "Луганская Народная Республика",
"95": "Херсонская Область"
}
for region_code, region_name in regions.items():
print(f"\n=== Обрабатываем регион {region_code} - {region_name} ===")
for exact_date in date_range:
for subsystem in subsystem_types:
for document_type in document_types:
print(f"\nПробуем subsystemType: {subsystem}, documentType44: {document_type}, Дата: {exact_date}")
response = send_soap_request(region_code, subsystem, document_type, exact_date)
if response:
download_archives(response, region_code, subsystem, document_type, exact_date, token)
else:
print("[INFO] Ответ сервера пустой или невалидный.")
if __name__ == "__main__":
main()