ServerXMLHTTP Object Fails When URL Contains More Than Two Spaces

Symptoms

If a URL contains more than two spaces, the ServerXMLHTTP object may fail with the following error message:
Run-time error '-2147012891 (80072ee5)' The URL is invalid

Resolution

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site: Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.
The English version of this fix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.


Date Version Size File Name Platform
-----------------------------------------------------------
4-May-2002 8.20.9703.0 1,120,768 Msxml3.dll x86

Workaround

To work around this problem, replace each space in the URL with the standard URL escape character (%20).

Status

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

More Information

Steps to Reproduce the Behavior

  1. Paste the following code in a text file, and then save the file as C:\Inetpub\wwwroot\Test.asp:
    <%
    Response.write Request.Querystring("data")
    Response.end
    %>
  2. In Microsoft Visual Basic 6.0, create a new Standard EXE project. By default, Form1 is added to the project.
  3. Paste the following code in the Load event of the form:
    Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")

    ' Line 1
    xmlhttp.Open "GET", "http://localhost/test.asp?data=select * from customers", False

    ' Line 2
    'xmlhttp.Open "GET", "http://localhost/test.asp?data=select%20*%20from%20customers", False

    xmlhttp.setRequestHeader "Content-type", "text/xml" '"application/xml"
    xmlhttp.send
    MsgBox xmlhttp.responsetext
    Debug.Print xmlhttp.responsetext
    MsgBox "Completed HTTP GET using ServerXMLHTTP Object"
  4. Run the project. Notice that you receive the error message that is listed in the "Symptoms" section of this article.
  5. Stop the project.
  6. Comment the line after Line 1, and then uncomment the line after Line 2.
  7. Run the project. Notice that a message box displays "Completed HTTP GET using ServerXMLHTTP Object." Notice that the URL uses the URL escape character (%20) instead of the spaces.
Proprietăți

ID articol: 312989 - Ultima examinare: 19 iun. 2014 - Revizie: 1

Feedback