Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-09-14
3
Medium Priority
?
1,845 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 200 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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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.
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…
Suggested Courses

877 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