conrad2010
asked on
xmlHTTP: The parameter is incorrect
I am posting a simple xml file to a URL...
Each time I'm geting the same error message: The parameter is incorrect
This doesn't tell me much of where to look for the problem... any ideas?
Dim xmlHTTP = Server.CreateObject("Msxml 2.ServerXM LHTTP") ' Msxml2.ServerXMLHTTP.4.0
xmlHTTP.open("GET", sURL, False)
xmlHTTP.setRequestHeader(" Content-Ty pe", "text/xml")
xmlHTTP.send(content)
sResponse = xmlHTTP.responseText
Each time I'm geting the same error message: The parameter is incorrect
This doesn't tell me much of where to look for the problem... any ideas?
Dim xmlHTTP = Server.CreateObject("Msxml
xmlHTTP.open("GET", sURL, False)
xmlHTTP.setRequestHeader("
xmlHTTP.send(content)
sResponse = xmlHTTP.responseText
ASKER
also tried this:
Dim content As MSXML2.DOMDocument
content = New MSXML2.DOMDocument
content.loadXML(Server.Map Path("~/") & "file.xml")
Dim content As MSXML2.DOMDocument
content = New MSXML2.DOMDocument
content.loadXML(Server.Map
>>xmlHTTP.open("GET", sURL, False)
should read :-
xmlHTTP.open("POST", sURL, False)
you cannot use GET to send content which has a mime type.
should read :-
xmlHTTP.open("POST", sURL, False)
you cannot use GET to send content which has a mime type.
ASKER
thanks... changed it to POST... same error message...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
c# is fine also...
still, suggested solution doesn't work...
still, suggested solution doesn't work...
Please post the complete code.
ASKER
Dim content as string = GetTextFromXMLFile(filenam
Private Function GetTextFromXMLFile(ByVal file As String) As String
Dim reader As StreamReader = New StreamReader(file)
Dim tmp As String = reader.ReadToEnd()
reader.Close()
reader.Dispose()
reader = Nothing
Return tmp
End Function