ASP XML ResponseText has 403 Error

Posted on 2005-04-20
Last Modified: 2008-01-09
Hi, I am sending XML data in ASP to another client's asp page. I keep getting 403 forbidden error (page can not be displayed) in the Response String. But when I go back and try again some time 4 Times, I then get a successful Response Status of 200.

My IIS does not have any ISAPI Filters to be executed. Is this error the clients IIS error of my IIS error?

This is the responseText:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "">  <HTML><HEAD><TITLE>The page cannot be displayed</TITLE>  <META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">  <STYLE type="text/css">    BODY { font: 8pt/12pt verdana }    H1 { font: 13pt/15pt verdana }    H2 { font: 8pt/12pt verdana }    A:link { color: red }    A:visited { color: maroon }  </STYLE>  </HEAD><BODY><TABLE width=500 border=0 cellspacing=10><TR><TD>    <h1>The page cannot be displayed</h1>  You have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed.  <hr>  <p>Please try the following:</p>  <ul>  <li>Contact the Web site administrator if you believe this directory should allow execute access.</li>  </ul>  <h2>HTTP Error 403.1 - Forbidden: Execute access is denied.<br>Internet Information Services (IIS)</h2>  <hr>  <p>Technical Information (for support personnel)</p>  <ul>  <li>Go to <a href="">Microsoft Product Support Services</a> and perform a title search for the words <b>HTTP</b> and <b>403</b>.</li>  <li>Open <b>IIS Help</b>, which is accessible in IIS Manager (inetmgr),   and search for topics titled <b>Configuring ISAPI Extensions</b>, <b>Configuring CGI Applications</b>, <b>Securing Your Site with Web Site Permissions</b>, and <b>About Custom Error Messages</b>.</li>  <li>In the IIS Software Development Kit (SDK) or at the <a href="">MSDN Online Library</a>, search for topics titled <b>Developing ISAPI Extensions</b>, <b>ISAPI and CGI</b>, and <b>Debugging ISAPI Extensions and Filters</b>.</li>  </ul>    </TD></TR></TABLE></BODY></HTML>  
Question by:edanladi
    LVL 27

    Expert Comment

    If I remember correctly it is necessary in ASP to use the correct XML HTTP object so that the request gets sent properly. Can you post your ASP code which does the request to the other machine?

    Author Comment

    'Post Data
    P_URL = ""
    Set XMLPost = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0")
    XMLPost.Open "Post", P_URL
    XMLPost.send pXMLStream

    'Get Response
    Set XMLResp = Server.CreateObject("Msxml2.DOMDocument")
    XMLResp.async = false
    Set XMLResp = XMLPost.responseXML

    Author Comment

    Actually I use this to get the xml string for storing in the database:

    pXMLResponse = ""
    c = 0
    Do While pXMLResponse = ""
          c = c + 1
          pXMLResponse = XMLPost.responseText

    Response.Write (XMLPost.Status) 'gives me 403
    Response.Write(pXMLResponse) 'Give me the erroe message included in my question above (the response text: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" .......)

    Expert Comment

    Function GETHTTP(P_URL)
    Set XMLPost = Server.CreateObject("Microsoft.XMLHTTP" )
    XMLPost.Open "Post", P_URL
    GETHTTP = XMLPost.Responsetext
    End Function


    icerik = GETHTTP(URL)
    LVL 27

    Expert Comment

    First the "POST" string on the open command suggests that you are going to post some data with the send command, which is what you don't do. It would look like :-

       Set datatopost = "parameter=" + escape(Value)

    If no data is to be send I'd use the "GET" method.

    Secondly the XMLPost.responseXML property is an XML DOM so you don't need to use the text property. One simply checks for parser error (XMLPost.responseXML.ParserError.errorCode) and uses the XML property to get the text ready to store away or whatever (XMLPost.responseXML.xml)

    Thirdly I'd replace version 3.0 with version 4.0 (or leave it out) when creating the server http object.

    Author Comment

    This is getting more complicated than I thought. All I am asking for is when I get a Post.Status of 400,500,600 etc a status that is not 200-->an OK post...whose HTTP/Server is to be checked at as the source of the problem?

    our servers or the clients? When we get the Post.Status <> "200", our servers are always running smoothly but I am not sure if our internet servers are to be blamed for a Post.Status that is not 200. We are sending a post to another client's URL and so is the POST.Status based on the clients HTTP problem or our problem?

    LVL 27

    Accepted Solution

    >>...whose HTTP/Server is to be checked at as the source of the problem?

    There are two aspects of this. First the reponse of 403 might be real - you might need to authenticate. Since you say "but I am not sure if our internet servers are to be blamed" I'm assuming that the request you are making is going wrong. Hence my first and third points.

    Because of the way IIS works any HTTP requests made out of it cannot use the WinINet control - hence this "ServerXMLHTTP" control. There have been problems with this thing which is why I suggested using the latest version.

    My second point was simply to save code and time.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    modThree challenge 4 53
    java continue statement 10 52
    find a node in VST 2 37
    bunnyEars challenge 6 45
    A short article about a problem I had getting the GPS LocationListener working.
    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now