i cant get fileappend to create the XML file. and i cant get my 2nd comobj to parse the xml as well.
my objective is to eventually have all the values exported to CSV (my work soap request contains a response with hundreds of values)
Code: Select all
xml =
(
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<NumberToWords xmlns="http://www.dataaccess.com/webservicesserver/">
<ubiNum>500</ubiNum>
</NumberToWords>
</soap:Body>
</soap:Envelope>
)
SendRequest(xml)
{
WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
WebRequest.Open("POST", "https://www.dataaccess.com/webservicesserver/NumberConversion.wso")
WebRequest.SetRequestHeader("Content-Type", "application/soap+xml; charset=utf-8")
WebRequest.SetRequestHeader("Host", "www.dataaccess.com")
try
WebRequest.Send(xml)
catch
return
Ontvangst := WebRequest.ResponseText
Msgbox, Ontvangst
FileAppend, Ontvangst, "C:\Users\admin\Desktop\test.xml"
;~ xmlPath := "C:\Users\admin\Desktop\test.xml"
xmlp := ComObjCreate("MSXML2.DOMDocument.6.0")
xmlp.async := false
xmlp.load(Ontvangst)
for n2w in xmlp.getElementsByTagName("soap:Body") {
Text := ""
Text .= n2w.getElementsByTagName("m:NumberToWordsResult").item(0).text
;~ Text .= n2w.getElementsByTagName("m:2").item(0).text
;~ Text .= n2w.getElementsByTagName("m:3").item(0).text
MsgBox % Text
}
}
F1::SendRequest(xml)
^r::reload
[Mod action: Topic moved from "Ask for Help (v2)" since this is v1 code. Please post in the correct section going forward.]