DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: XMLHTTPRequest: Run-Time Error on .Send Command

  1. #1
    Join Date
    Aug 2005
    Posts
    2

    XMLHTTPRequest: Run-Time Error on .Send Command

    I am trying to submit an XML request object and subsequently receive an XML response object but cannot proceed past the "http.send reqDoc" command.

    I receive two different errors messages when attempting to submit the XML object. The first message is produced on the following line of code:

    http.send reqDoc

    My system hangs for about 2 minutes on this line and then produces the following message:

    Run-time error '-2146697208 (800c0008)':
    The download of the specified resource has failed.

    After I receive this message the application fails and I have to restart the application. After restarting the application the "http.send reqDoc" line executes but the http object indicates that the response XML object has not been received. It is at this point that I receive the second message which is:

    Input Segments are Invalid

    I believe that the "Input Segments are Invalid" message is on account of the XML string not being formatted properly, however, I am unsure why I only receive this message after I stop and restart the application.

    Can anyone explain what is causing the first error message?


    The VB code is as follows:


    PHP Code:
    Private Sub BtnSubmit_Click()

    ' Build XML Object
        
        ' 
    Create an empty DOM document
        Dim reqDoc 
    As MSXML2.DOMDocument40
        Set reqDoc 
    CreateObject("Msxml2.DOMDocument.4.0")
        
    ' Post XML Object To Equifax
        
        ' 
    Submit the request to the server
        Dim a 
    As Boolean
        Dim http 
    As MSXML2.XMLHTTP40
        Set http 
    CreateObject("Msxml2.XMLHTTP.4.0")
        
    http.open "POST""https://www.website.com/processingpage.asp"False
        reqDoc
    .Load ("C:\customerdata1.xml")
        
    http.send reqDoc
        
        
    ' Check for HTTP errors
        If http.Status <> 200 Then
            ' 
    Complain about the error
            TxtResults
    .Text "HTTP Error " http.Status " (" http.statusText " occurred)"
            
    Exit Sub
        End 
    If
        
        
    ' Get the response document from the server
        Dim respDoc As MSXML2.DOMDocument40
        Set respDoc = CreateObject("Msxml2.DOMDocument.4.0")
        respDoc.setProperty "SelectionLanguage", "XPath"
        respDoc.Load (http.responseStream)
        
        ' 
    Check for XML parse errors
        
    If respDoc.parseError.errorCode <> 0 Then
            
    ' Complain about the error
            tmpString = "Invalid response: " & respDoc.parseError.reason & " at line " & respDoc.parseError.Line
            Exit Sub
        End If

    End Sub 

  2. #2
    Join Date
    Aug 2005
    Posts
    23
    You probably want to use "Msxml2.FreeThreadedDOMDocument.4.0"
    and set it to async = false, so that it will be assured that it is fully loaded during the .Load( ) before you attempt to send it.

  3. #3
    Join Date
    Aug 2005
    Posts
    2
    Thanks KC... I will try that and let you know.

    I was able to fix the second error message by changing all quotations in the XML body from single quotes to double quotes but am still receiving the first message!

    Hopefully what you suggest will work...

    Thanks,
    A2Z

Similar Threads

  1. query tuning
    By dhaya in forum Database
    Replies: 11
    Last Post: 08-25-2003, 05:24 PM
  2. Run time Error '430'
    By Arunkumar in forum VB Classic
    Replies: 1
    Last Post: 07-03-2002, 06:18 AM
  3. Beta2 Southern Hemisphere Blues
    By Esmond Hart in forum .NET
    Replies: 2
    Last Post: 01-14-2002, 08:24 AM
  4. run time error "3633"???
    By DH in forum VB Classic
    Replies: 1
    Last Post: 11-07-2001, 02:43 PM
  5. Run Time Controls
    By John in forum .NET
    Replies: 2
    Last Post: 10-10-2001, 03:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center