Fordraiders
asked on
reading a xml file and sending to web service call and read response
Access 365 vba
I have a xml file i need to send to a service call and get a response back.
cant seem to get the xml document to load correctly.
Thanks
fordraiders
I have a xml file i need to send to a service call and get a response back.
Dim myHTTP As New MSXML2.XMLHTTP30
Set myHTTP = CreateObject("msxml2.xmlhttp")
'create dom document variable
'stores the xml to send
Dim myDom As New MSXML2.DOMDocument30
'Create the DomDocument Object
Set myDom = CreateObject("MSXML2.DOMDocument")
'Load entire Document before moving on
myDom.async = False
'xml string variable
'replace with location if sending from file or URL
myDom.Load ("C:\Users\br1d\OneDriveinc\Desktop\RedBook Escalation\Skusubmission.xml")
'loads the xml
'change to .Load for file or url
myDom.Load (myDom.XML)
'open the connection
myHTTP.Open "POST", "https://xxxx01.dev-sap.gr.com:41111/sap/commerce/esrprice?sap-client=220", False, "xxxxx", "xxxxx"", False"
'send the XML
myHTTP.Send (myDom.XML)
'Display the response
MsgBox myHTTP.responseText
cant seem to get the xml document to load correctly.
Thanks
fordraiders
ASKER
myDom.Load ("C:\Users\br1d\OneDriveinc\Desktop\RedBook Escalation\Skusubmission.xml")
it does not load the xml file at all.
it does not load the xml file at all.
If you put the "C:\Users\br1d\OneDriveinc\Desktop\RedBook Escalation\Skusubmission.xml "
in the explorer's address bar does it shows the Xml ?
in the explorer's address bar does it shows the Xml ?
is the path correct?
whats the exact error message?
also can you use XML 6.0
whats the exact error message?
also can you use XML 6.0
Dim myDom As MSXML2.DOMDocument60 ' declare the xml doc object
Set myDom = New MSXML2.DOMDocument60 ' set an instance of it to memory
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
which line fails?