Help sending XML file to server, reading response
Hello. I'm working with a mapping service that has sent me plenty of code examples in Java and CGI, but I'm having trouble with the conversion to ASP .NET.
The conversation will execute upon start of an aspx form (and is therefore located in the Sub Page_Load). I have the code below but cannot figure out how to directly send the XML file to the server. I've tried reading the XML to a string and sending the string, but that seems to be a real stupid way of transmitting that file.
In synopsis, I want to send map.xml to their server and read the response. The response is a .GIF. Help is appreciated!
Code looks like this (but is obviously not what I need). Note that I don't think I should be using .send but should be using something that actually sends an XML file called "map.xml". Hell, all I need to know is to post and read response - .NET making me feel foolish.
Dim oHTTP As New Object()
Dim sResponseXML As String
oHTTP = Server.CreateObject("Microsoft.XMLHTTP")
oHTTP.open("POST", "http://www.maptuit.com/XMLServer/Request.xs", False)
oHTTP.setRequestHeader("Content-Type", "text/xml")
** oHTTP.send("<the XML that I want to be a file>")
sResponseXML = oHTTP.responseText
oHTTP = Nothing
|