Сначала генерим xml
Name DataType Subtype Length
Document Automation 'Microsoft XML, v3.0'.DOMDocument30
xmlElement Automation 'Microsoft XML, v3.0'.IXMLDOMElement
IF NOT ISCLEAR(Document) THEN
EXIT;
IF NOT CREATE(Document,TRUE) THEN
ERROR('Не могу создать xml ');
Document.async(FALSE);
xmlInstruction := Document.createProcessingInstruction('xml', 'version=''1.0'' encoding=''UTF-8''');
xmlElement := Document.createElement('ROOT_ELEMENT');
Document.appendChild(xmlElement);
Document.insertBefore(xmlInstruction, xmlElement);
далее наполнение xml.....
Потом отправляем его на url, способный его "переварить"
Name DataType Subtype Length
XMLHTTP Automation 'Microsoft XML, v3.0'.XMLHTTP
SendFile2Url(VAR auDoc : Automation "'Microsoft XML, v3.0'.DOMDocument";pUrl : Text[200]) Result : Text[300]
IF NOT ISCLEAR(XMLHTTP) THEN
CLEAR(XMLHTTP);
CREATE(XMLHTTP);
XMLHTTP.open('POST',pUrl, FALSE);
XMLHTTP.setRequestHeader('Content-Type: ', 'application/x-www-form-urlencoded');
XMLHTTP.send(auDoc);
IF XMLHTTP.status<>200 THEN
EXIT(STRSUBSTNO('Result %1: %2',XMLHTTP.status,COPYSTR(XMLHTTP.statusText,1,250)));
|