MSXML Load strange behanior RRS feed

  • Question

  • User793095348 posted

     First let me state that I'm not the developer but the IIS admin.

     The site that my servers are hosting have a lot of call like the following

       set xml = Server.CreateObject("Msxml2.DomDocument.6.0")
       xml.async = false
        xml.setProperty "ServerHTTPRequest", true

     I asked the developers to change their load call to use Server.MapPath as requesting the file by the URL causes the request to go to our reverse proxy servers and then to one of the servers in my distributed web farm. Since these files can be served by the server making the xml.load call I asked the developers to change their calls to use Server.MapPath to lessen network traffic and speed up response times.

    For example: xml.load(Server.MapPath("/rss/news_description.rss"))

    However when we use the Server.MapPath the load statement returns the follwoing error

    Reason: A name was started with an invalid character.
    Number: -1072896764
    Line: 2

    Why would the load statement cause different results using Server.MapPath ?





    Tuesday, October 25, 2011 12:54 PM

All replies

  • User-1672167363 posted


    Starting from the bottom question and then dealing with other errors.

    For the Server Map Path Method  depends on how you have the IIS Server

    Configured for "Enable Parent Paths" the "Default is "Disabled".

    Look at MSDN Library http://msdn.microsoft.com/en-us/library/ms524632(v=vs.90).aspx for more information.

    You may have other problems with allowed characters paths and urls as part of the code.

    Look at IIS Team Wade Hilmo's Post http://blogs.iis.net/wadeh/archive/2011/04/20/how-iis-blocks-characters-in-urls.aspx 

    and also make note of the "Allowed Restricted" link and RFC 2396 information

    and  link to the information or  print a copy of all three for the Developers it may be related

    to the  current problems & errors:

    Reason: A name was started with an invalid character.
    Number: -1072896764
    Line: 2

    Not having the full code makes this hard to answer.






    Wednesday, October 26, 2011 1:20 AM
  • User793095348 posted

     Thanks for the response.

     Enabling parent paths didn't make a difference and since the the Server.MapPath begins with a '/' it should be grabbing the path from the root of the site and not be using parent paths.

    I've looked at the XML variable in the Visual Studio watch window for the Server.MapPath command and this is what I see

    -        parseError    {...}    IXMLDOMParseError2
    -        [Methods]    {...}    IXMLDOMParseError2
            errorParameters()    errorParameters(index)    String
            allErrors    Nothing    Object
            errorCode    -1072896764    Long
            errorParametersCount    0    Long
            errorXPath    ""    String
            filepos    46    Long
            line    2    Long
            linepos    2    Long
            reason    "A name was started with an invalid character.
    "    String
            srcText    "<% Response.Buffer = true"    String

    This is the code at the top of the news_description.rss file

     <?xml version="1.0" encoding="ISO-8859-1"?>
    <% Response.Buffer = true
       Response.ContentType = "text/xml"

     In Visual Studio the line "<% Respones.Buffer = True " is marked as an error "Character '%',...is illegal in an XML name.". But when I call mysite/rss/news_description.rss it loads without a problem.





    Wednesday, October 26, 2011 10:31 AM
  • User-1672167363 posted


    Visual Studio may not be providing the correct validation for the XML part of the code:

    Download and install XML Note Pad http://www.microsoft.com/download/en/details.aspx?id=7973 and then look at the XML code.

    For the Server Map path " relative or virtual path to the corresponding physical directory on the server

    which is part of the "Enable Parent Paths" settings.

    You did restart the IIS Server after making the change to the "Enable Parent Paths" ?

    You might read Robert McMurrays Post


    the some of the problems with includes and paths and changes for the ASP coding.




    Wednesday, October 26, 2011 11:10 AM
  • User-1672167363 posted

    Hi Hugh,

    Have you contacted the developers and presented written plan needing

     "Server.MapPath" and added the information from the Forum posts

    with your current  problems ?




    Thursday, October 27, 2011 6:17 AM
  • User793095348 posted

    No. I appreciate your efforts but I don't think you're on the right track. 

    It seems that when we do the xml.load call with a URL the IIS servers process the file like it would an asp file (the .rss extension is mapped to the isapimodule) which returns XML. When we use the xml.load with server.mappath the the call is expecting the news_description.rss file to be XML which it isn't.

    I'm going to need to find another way to keep the calls local to the server.








    Thursday, October 27, 2011 9:47 AM
  • User-1672167363 posted


    Sorry must have read something wrong:(



    Thursday, October 27, 2011 11:44 AM