Results 1 to 3 of 3

Thread: HELP!!! XMLHTTP.Send Hangs

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2006
    Posts
    4

    HELP!!! XMLHTTP.Send Hangs

    I have a client who is stuck!!!

    In my VB6 application I am making a call to a web service. One client using our application in the production environment is reporting that his machine locks up when performing the web service call. No other clients hitting the same web service are having problems.

    Does anyone have any idea as to what would make the XMLHTTP.Send method hang?

    Clients's machine Specs.
    OP = Windows XP Service Pack 2
    MSXML 3 and 4 have been installed
    User can access the HTTP call manually through his browser.

    Code is as follows

    Dim xmlURL As XMLHTTP

    Set xmlURL = New XMLHTTP

    xmlURL.Open "POST", "http://WebServiceAddress", False, UserName, Password
    xmlURL.setRequestHeader "Content-Type", "application/xml; charset=utf-8"
    xmlURL.Send "xml Text"

    Thanks for your help!

  2. #2
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: HELP!!! XMLHTTP.Send Hangs

    this is how i send values to a webpage and retrieve text using MSXML ..
    I have more advanced versions laying around here .. but honestly Winsock is better. Or API if you dont want to install any controls (example for a self executable file).

    VB Code:
    1. Private Sub Command1_Click()
    2.     Text1.Text = SendXMLRequest("http://www.somewebsite.com/?id=1")
    3. End Sub
    4.  
    5. '// REFERENCE MS XML, Version 2.0
    6. Private Function SendXMLRequest(ByVal strUrl As String) As String
    7. On Error GoTo err:
    8.     Dim objHTTP As MSXML.XMLHTTPRequest
    9.     Set objHTTP = New MSXML.XMLHTTPRequest
    10.     objHTTP.Open "GET", strUrl, False
    11.     objHTTP.setRequestHeader "Content-Type", "text/html"
    12.     objHTTP.send: SendXMLRequest = objHTTP.responseText
    13.     If Len(SendXMLRequest) = 0 Or InStr(1, SendXMLRequest, _
    14.     "page not found", vbTextCompare) Then _
    15.     SendXMLRequest = "Page Not Found"
    16.     Exit Function
    17. err:
    18.     SendXMLRequest = "Error " & err.Number & _
    19.     vbCrLf & err.Description
    20.     Exit Function
    21. End Function

    Or ..
    VB Code:
    1. Dim objHTTP As New MSXML.XMLHTTPRequest                         ' CREATE OBJECT
    2.     objHTTP.Open "GET", strUrl, True                                ' START REQUEST
    3.     objHTTP.setRequestHeader "Content-Type", "text/html"
    4.     objHTTP.send                                                    ' SEND REQUEST
    5.     '//Do Until objHTTP.readyState = 4: DoEvents: Loop
    6.     SendRequest = objHTTP.responseText                              ' GET TEXT
    Last edited by rory; Oct 27th, 2006 at 01:02 AM.

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2006
    Posts
    4

    Re: HELP!!! XMLHTTP.Send Hangs

    Thanks for the reply rory, but my code is basically the same. It works on other machines, just one machine will not respond at the objHTTP.Send line.

    Does any one know about an IE option, windows firewall, or anything else that would block XML content?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width