Solved

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

Posted on 2004-09-14
3
1,661 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
Comment Utility
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
Comment Utility
actually object is ServerXMLHTTP
0
 

Author Comment

by:danBosh
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now