We help IT Professionals succeed at work.
Get Started

Getting error 2146697208 when sending an XML document

dcsweb
dcsweb asked
on
10,129 Views
Last Modified: 2012-05-05
I am sending multiple XML requests to another server and at some point (which differs every time I run it), I will get "Error: -2146697208 The download of the specified resource has failed."  I have XML requests stored in a database and am using VB 6.0 to send them to another server, looping through each one. Sometimes I can only send 2 requests before I get this error, sometimes 10, sometimes more. I have determined that it dies on the "myxml.Send mydoc" statement and I am at a complete loss as to what causes this error and how to fix it.
Set myxml = CreateObject("Microsoft.XMLHTTP")
    Set myxsl = CreateObject("MSXML2.DOMDocument")
    myxsl.Load ("myfile.xsl")
    Set mydoc = CreateObject("MSXML2.DOMDocument")
    
    CommandText = "Select <<fields>> From <<table>>"
    Set qry = DBConn.Execute(CommandText, , adCmdText)
    
    If qry.BOF And qry.EOF Then
    Else
        qry.MoveFirst
        Do While Not qry.EOF
            '******************************
            'myXMLquery is defined here
            '******************************
            mydoc.loadXML myXMLquery
            Dummy = LogIt("mydoc.loadXML loaded")
            
            If mydoc.parseError.ErrorCode Then
                Dummy = LogIt("mydoc.parseError.ErrorCode = " & mydoc.parseError.ErrorCode)
            Else
                myxml.Open "GET", "http://<<otherserver>>", False
                Dummy = LogIt("myXML.Open successful")
                myxml.setRequestHeader "Content-type", "text/xml"
                myxml.Send mydoc
                Dummy = LogIt("XML document sent")
                
                Set myresponse = myxml.responseXML
                Dummy = LogIt("XML response received")
               
                '******************************
                'now process the response
                '******************************
                myresponse.transformNodeToObject myxsl, mydoc
                'results stored in a database here
            End If
            qry.MoveNext
        Loop
    End If
    
    qry.Close
    Set qry = Nothing
    
    Set mydoc = Nothing
    Set myxml = Nothing
    Set myxsl = Nothing
    Set myresponse = Nothing

Open in new window

Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE