MSXML2.ServerXMLHTTP call in macro


I have a macro that calls a j2ee integration object and displays the xml data in a cell in my excel

Public Sub Macro1()
Dim result As String
Dim myURL As String, postData As String
Dim winHttpReq As Object
Dim xmlhttp, responsexml As String

Dim usedRowRange As Integer
usedRowRange = ActiveSheet.UsedRange.Rows.Count
Set winHttpReq = CreateObject("MSXML2.ServerXMLHTTP")
myURL = "http://qdon:9080/os/labor"
postData = ("<Query" + "labor" + " xmlns:xsi="""" xmlns="""">" & _
    "<" + "labor" + "Query>" & _
    "</" + "labor" + "Query>" & _
    "</Query" + "labor" + ">")
winHttpReq.Open "POST", myURL, False
winHttpReq.setrequestheader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
winHttpReq.Send (postData)
'Response.ContentType = "text/xml"
'result = winHttpReq.responseText
result = winHttpReq.responsetext
'result = postData
'MsgBox (result)
Sheet1.Range("B2").Value = result
'Sheet1.Cells("A1").Value = result

Open in new window

i would like also to save the xml into a file called ""test.xml" on my c:\temp directory, can anyone assist me on this pls?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

what is qdon?
rutgermonsAuthor Commented:
its a j2ee url (dummy) for a business system the http call is to extract data from the labor object within that solution
This code will write the XML.
Dim intFN as Integer

Open "C:\Temp\test.xml" For Output As intFN
Print #intFN, result
Close #intFN

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.