Solved

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

Posted on 2004-09-14
3
1,743 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

749 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