SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2011
    Location
    Albany, NY
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ASP, MSXML2.ServerXMLHTTP and authentication

    My company is using a web hosting company to host the company’s website. We are provided a dev environment and a production environment.
    The dev box is win 2000 server. The production box is win 2003 or 2008 server, I can’t remember. I also have a dev box in my office running windows 7 and IIS. The web hosting company provides a web page to replicate content from dev to prod. The page provides the status of replication. In order to update the status, I need to reload the page. Who wants to press F5 for 8 to 15 minutes? Not me. To get around this, I created a page that uses MSXML2.ServerXMLHTTP.4.0 to load the page, and indicate the status. I then added this page to an iframe and used javascript to reload the iframe on a constant basis until the status = “complete”. I’ve been running the code on the development box and all is good. The other day, I tried running the code on the production server and got an error message:

    msxml4.dll error '80072efd'
    A connection with the server could not be established

    I looked into this and found out that Microsoft is no longer supporting xml parser 4. I’m now rewriting the page to work with xml parser 6.
    Here is the original code that used to work in dev and prod:

    url = " http://site.com/SiteServer/Admin/publishing/Prj.asp"
    set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP.4.0")
    Response.AddHeader "WWW-Authenticate", "NTLM"
    xmlhttp.open "GET", url, false, "user", "password"
    xmlhttp.send
    Response.write xmlhttp.responseText

    I’ve tried rewriting the code and it’s working in dev environment, but not in prod. In prod, the code returns a HTTP 401.1 - Unauthorized: Logon Failed. Now before you tell me to simply run the page on the dev box, let me explain why I am switching to prod:
    1. My site uses a database to allow or hide site features.
    2. Features are being reviewed on the dev box before they are released into production.
    3. I need to push the site to production while features are being reviewed and I don’t want to turn off the features in dev while the site replicates and turn them back on afterwards. (requires pre replication and post replication action pages)
    4. I can setup a page to run on the prod box after replication finishes, to turn on or off approved features. (post replication action page)
    5. I can’t get the ASP code running on the Dev box to modify the DB on the production server for obvious security reasons.

    This is why I want to run the replication page on the production server. Load replication page, refresh status till complete and then run some post replication code to hide unapproved features.

    My rewrite of the page:

    url = "http://site.com/SiteServer/Admin/publishing/Prj.asp"
    set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP.6.0")
    Response.AddHeader "WWW-Authenticate", "NTLM"
    xmlhttp.open "GET", url, false, "user", "password"
    xmlhttp.send
    Response.write xmlhttp.responseText

    I’ve also tried the rewrite above on my dev box here in the office since it mirrors what the host company uses for a prod environment. I’m getting HTTP 401.1 - Unauthorized: Logon Failed error.

    My question is this:
    1. What do I do to get MSXML2.ServerXMLHTTP.6.0 to correctly authenticate?
    2. Is this due to a change in the specification for version 6 of the parser?

    Mike

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2012
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2011
    Location
    Albany, NY
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My solution was to, upon completion of replication, submit the form with the checkboxes to a page on the production server. That allowed the page on the server to know what checkboxes are checked and what actions to complete.

    Thus I was able to run the replication page on the deveopment box and get the post replication actions to happen in production. As long as the post replication runs in an iframe, noone will see it, unless of course, in my case, I wanted output that told me what actions were completed.

    action1...action2...action5...


Tags for this Thread

Bookmarks

Posting Permissions

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