-
Notifications
You must be signed in to change notification settings - Fork 42
/
SOAP & XML Search.au3
46 lines (31 loc) · 1.05 KB
/
SOAP & XML Search.au3
1
2
3
4
5
6
7
8
9
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
#include <Array.au3>
Global $oMyError
$XMLFile = "C:\TEMP\1.xml"
#region SOAP Section
$oSOAP = ObjCreate("MSSOAP.SoapClient30")
$oSOAP.mssoapinit("http://www.webservicex.net/stockquote.asmx?WSDL")
$oSOAP.ConnectorProperty("ProxyServer") = "192.168.101.54:80"
$oSOAP.ConnectorProperty("ProxyUser") = "SBICZA01\a159994"
$oSOAP.ConnectorProperty("ProxyPassword") = "AA!^16"
$String = $oSOAP.GetQuote("MSFT")
;ConsoleWrite($String)
$oFile = FileOpen($XMLFile,2)
FileWrite($oFile,$String)
FileClose($oFile)
#endregion
#region XML Searching
$objXML = ObjCreate("Msxml2.DOMDocument.6.0")
$objXML.async = False
$objXML.preserveWhiteSpace = True
$objXML.validateOnParse = True
$objXML.Load($XMLFile)
$objXML.setProperty ("SelectionLanguage", "XPath")
$Nodes = $objXML.SelectNodes("/StockQuotes/Stock")
For $Node in $Nodes
ConsoleWrite($Node.SelectSingleNode("Name").text & @CRLF)
Next
$SearchNodes = $objXML.SelectNodes("/NewDataSet/Table[Name='South Africa']")
For $Node in $SearchNodes
ConsoleWrite($Node.SelectSingleNode("Name").text & @CRLF)
Next
#endregion