Here is the code that DeepDave used.
Sub POSTExample() Dim request As XMLHTTP
Dim myValue As String
Dim doc As DOMDocument60
myValue = "GOOG"
Set request = New XMLHTTP
Set doc = New DOMDocument60
With request
.Open "POST", "http://www.webservicex.net/stockquote.asmx/GetQuote", False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.send "symbol=" & myValue
doc.LoadXML .responseText
End With
doc.LoadXML doc.Text
Debug.Print doc.SelectSingleNode("//Name").Text, doc.SelectSingleNode("//Date").Text, doc.SelectSingleNode("//High").Text
End Sub
Sub test()
Dim doc As DOMDocument60
Dim req As XMLHTTP
Dim node As IXMLDOMElement
Dim root As Object
Dim response As DOMDocument
Set doc = New DOMDocument60
Set root = doc.createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'")
doc.appendChild root
Set node = doc.appendChild(doc.createElement("soap:Envelope"))
With node
.setAttribute "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"
.setAttribute "xmlns:xsd", "http://www.w3.org/2001/XMLSchema"
.setAttribute "xmlns:soap", "http://schemas.xmlsoap.org/soap/envelope/"
With .appendChild(doc.createElement("soap:Body"))
Set node = .appendChild(doc.createElement("GetQuote"))
node.setAttribute "xmlns", "http://www.webserviceX.NET/"
node.appendChild(doc.createNode(NODE_ELEMENT, "symbol", "http://www.webserviceX.NET/")).Text = "GOOG"
End With
End With
Set req = New XMLHTTP
req.Open "POST", "http://www.webservicex.net/stockquote.asmx", False
req.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
req.setRequestHeader "SOAPAction", "http://www.webserviceX.NET/GetQuote"
req.setRequestHeader "Content-Length", Len(doc.XML)
req.send doc.XML
Set response = New DOMDocument
response.LoadXML (req.responseText)
response.LoadXML response.SelectSingleNode("//GetQuoteResult").Text
Debug.Print response.SelectSingleNode("//Name").Text, response.SelectSingleNode("//Date").Text, response.SelectSingleNode("//High").Text
End Sub