Solved

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

Posted on 2004-09-14
3
1,783 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

632 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