Solved

Method 'send' of object 'IXMLHTTPRequest' failed : -2146697211

Posted on 2004-09-14
3
1,724 Views
Last Modified: 2012-05-05
In the piece of code below i get the error "Method 'send' of object 'IXMLHTTPRequest' failed : -2146697211" if i set the parameter "showInBrowser" to 0 in the xml sent in the request. Where as if i set it to 1, i get a good http responce back.

Any idea why this occurs?



Private Sub Command6_Click()

Dim req As New MSXML2.XMLHTTP30

' Specify the URI of the GetRandomNumber method

req.Open "POST", "http://888.217.203.154/application/cmti/SearchflowQueryXML.asp", False
 
' Set the HTTP Headers
req.setRequestHeader "HOST", "localhost"
req.setRequestHeader "Content-Type", "text/xml"


Dim xmlstring As String
xmlstring = "<?xml version=" & Chr$(34) & "1.0" & Chr$(34) & " encoding=" & Chr$(34) & "utf-8" & Chr$(34) & "?>" & vbCrLf
xmlstring = xmlstring & "<SearchflowQuery ShowInBrowser=" & Chr$(34) & "0" & Chr$(34) & "><Authentication><Source>SSLConvey</Source><Password>age</Password><User>harnys</User></Authentication><GetSearches><ClientRef>abc123</ClientRef></GetSearches></SearchflowQuery>"


Debug.Print xmlstring
req.send xmlstring

Dim responseStr As String
responseStr = "Content-Type: " & req.getResponseHeader("Content-Type") & vbCrLf
responseStr = responseStr & "Content-Length: " & req.getResponseHeader("Content-Length") & vbCrLf
responseStr = responseStr & req.responseText & vbCrLf & req.responseBody & vbCrLf & req.statusText

 
Debug.Print responseStr

End Sub

0
Comment
Question by:danBosh
  • 2
3 Comments
 
LVL 8

Expert Comment

by:mladenovicz
ID: 12052591
Make sure that you have IE 5.0 or higher.
Try to use xmlHTTPServer object instead of XMLHTTP30
0
 
LVL 8

Accepted Solution

by:
mladenovicz earned 50 total points
ID: 12052599
actually object is ServerXMLHTTP
0
 

Author Comment

by:danBosh
ID: 12052637
This issue has nothing to do with a browser at the moment. I am merely running the VB code.

Why will ServerXMLHTTP make any difference?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

766 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question