Link to home
Start Free TrialLog in
Avatar of conrad2010
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("Msxml2.ServerXMLHTTP")    ' Msxml2.ServerXMLHTTP.4.0
xmlHTTP.open("GET", sURL, False)
xmlHTTP.setRequestHeader("Content-Type", "text/xml")
xmlHTTP.send(content)
sResponse = xmlHTTP.responseText
Avatar of conrad2010
conrad2010

ASKER

where "content" is the XML from a xml file...


Dim content as string = GetTextFromXMLFile(filename)

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
also tried this:

Dim content As MSXML2.DOMDocument
content = New MSXML2.DOMDocument
content.loadXML(Server.MapPath("~/") & "file.xml")
>>xmlHTTP.open("GET", sURL, False)

should read :-

xmlHTTP.open("POST", sURL, False)

you cannot use GET to send content which has a mime type.
thanks... changed it to POST... same error message...
ASKER CERTIFIED SOLUTION
Avatar of BigRat
BigRat
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
c# is fine also...

still, suggested solution doesn't work...
Please post the complete code.