I have access to an API. The API takes an XML post as input and then returns an XML response with the relevant data.
I want to
If you need to send your input xml as the message body here is how you can do it. You may need to add more or change the Request headers to get it to work for you.
Using the DOMDocument object make it easy to work with your xml documents.
Add a project references to;
Example:
Dim xmlInput As String
xmlInput = ""
Dim oXmlHttp As MSXML2.XMLHTTP60
Set oXmlHttp = New MSXML2.XMLHTTP60
oXmlHttp.Open "POST", serviceURL, False, "UserName", "Password"
oXmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oXmlHttp.setRequestHeader "Connection", "Keep-Alive"
oXmlHttp.setRequestHeader "Accept-Language", "en"
oXmlHttp.send xmlInput
Debug.Print oXmlHttp.responseText
Dim oXmlReturn As MSXML2.DOMDocument60
Set oXmlReturn = New MSXML2.DOMDocument60
oXmlReturn.loadXML oXmlHttp.responseText