PDA

Просмотр полной версии : Веб-сервис EMEX.ru и 1с 7.7 ТиС



Novikovis
13.10.2016, 07:14
Добрый день!
Гуру и боги 1с помогите.
Задача такая, есть сайт emex.ru и есть база ТиС, нужно настроить отправку данных из ТиС на сайт, по XMLHTTP.
Знаю что у эмекса есть сервис http://ws.emex.ru/EmExInmotion.asmx/TestConnect
Если из браузера обратиться так: http://ws.emex.ru/EmExInmotion.asmx/TestConnect?s=123
то получаю ответ, а из 1с получаю ответ "500: Internal Server Error, Request format is invalid: text/html, UTF8."
Может кто подскажет в какую сторону капать?
Вот код обработ

Сформировать()
MessageExchange= "
|<?xml version=""1.0"" encoding=""utf-8""?>
|<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">
| <soap:Body>
| <TestConnect xmlns=""http://tempuri.org/"">
| <s>string</s>
|</TestConnect>
|</soap:Body>
|</soap:Envelope>";
xmlHttp = СоздатьОбъект("MSXML2.XMLHTTP");
xmlHttp.OPEN("POST", "http://ws.emex.ru/EmExInmotion.asmx/TestConnect", 0);
xmlHttp.setRequestHeader("User-Agent", "1C Soap toolkit");
xmlHttp.setRequestHeader("Content-Type","text/xml, UTF8");
xmlHttp.setRequestHeader("Content-Length", ИИИИ(MessageExchange));
xmlHttp.setRequestHeader("SOAPAction", "http://tempuri.org/TestConnect");
xmlHttp.SEND(MessageExchange);
Если xmlHttp.status = 200 ИИ?
Результат = "" + xmlHttp.responseText
Иначе
Результат = "" + xmlHttp.status + ": " + xmlHttp.StatusText;
КонецЕсли;
Сообщить(Результат);
Сообщить(xmlHttp.responseText);
КонецПроцедуры