error creating XMLHttpRequest

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • steveH

    error creating XMLHttpRequest

    Hi, I'm trying to solve a problem for a user which I can neither
    reproduce or explain. Here goes in the hope that someone else may have
    experienced the same.
    I make two attempts to create the XMLHTTP object, using the progids
    "Msxml2.XMLHTTP " and (if that fails) "Microsoft.XMLH TTP". If the latter
    fails I display the error. The error appearing is ""NULL" is
    undefined". I'm still awaiting confirmation of the exact browser
    version, but the screenshot I have looks like IE5.5, and the company
    info in the titlebar indicates that it's a customised install.
    I'm completely out of ideas on this one - no hits whatsoever in google
    for this error message in this context.

    thanks

  • Matt Kruse

    #2
    Re: error creating XMLHttpRequest

    steveH wrote:[color=blue]
    > I make two attempts to create the XMLHTTP object, using the progids
    > "Msxml2.XMLHTTP " and (if that fails) "Microsoft.XMLH TTP". If the
    > latter fails I display the error. The error appearing is ""NULL" is
    > undefined".[/color]

    Can you post your code? It's impossible to guess at what the problem is
    without seeing your code :)

    This is an example of creating the object from my Ajax Toolbox:

    /**
    * Returns an XMLHttpRequest object, either as a core object or an ActiveX
    * implementation. If an object cannot be instantiated, it will return null;
    */
    AjaxRequest.get XmlHttpRequest = function() {
    if (window.XMLHttp Request) {
    return new XMLHttpRequest( );
    }
    else if (window.ActiveX Object) {
    // Based on http://jibbering.com/2002/4/httprequest.html
    /*@cc_on @*/
    /*@if (@_jscript_vers ion >= 5)
    try {
    return new ActiveXObject(" Msxml2.XMLHTTP" );
    } catch (e) {
    try {
    return new ActiveXObject(" Microsoft.XMLHT TP");
    } catch (E) {
    return null;
    }
    }
    @end @*/
    }
    else {
    return null;
    }
    };


    --
    Matt Kruse




    Comment

    • Martin Honnen

      #3
      Re: error creating XMLHttpRequest



      steveH wrote:

      [color=blue]
      > I make two attempts to create the XMLHTTP object, using the progids
      > "Msxml2.XMLHTTP " and (if that fails) "Microsoft.XMLH TTP". If the latter
      > fails I display the error. The error appearing is ""NULL" is
      > undefined". I'm still awaiting confirmation of the exact browser
      > version, but the screenshot I have looks like IE5.5, and the company
      > info in the titlebar indicates that it's a customised install.[/color]

      We need to see your code.
      It is possible to disable ActiveX in IE for a zone so that could be a
      cause of the problem.


      --

      Martin Honnen

      Comment

      • steveH

        #4
        Re: error creating XMLHttpRequest

        Thanks for the replys, here's the code

        try {
        var o = new ActiveXObject(" Msxml2.XMLHTTP" );
        return o;
        }
        catch (e){
        try {
        var o = new ActiveXObject(" Microsoft.XMLHT TP");
        return o;
        }
        catch(e){
        errDialogShow(" Error in Calculator","Un able to create
        XMLHTTP\n\""+e. message + "\"");
        return null;
        }
        }


        works for the vast majority of users, works for me in IE6 & IE5.5 (this
        is from a factory object, a different object altogether creates FireFox
        object). For the problem case, the error message displays (Title)
        "Error in Calculator" (Message) Unable to create XMLHTTP "NULL" is
        undefined". Any attempt I make to disable activex/uninstall XMLHTTP to
        try and reproduce the error just results in the expected message
        "Unable to create XMLHTTP Automation server cannot create object"

        Comment

        • Matt Kruse

          #5
          Re: error creating XMLHttpRequest

          steveH wrote:[color=blue]
          >errDialogShow( "Error in Calculator","Un able to create
          >XMLHTTP\n\""+e .message + "\"");[/color]
          [color=blue]
          >"NULL" is undefined".[/color]

          Try doing some simple alerts before your Dialog call:

          alert(e);
          alert(e.message );

          to make sure that there's suff in there.

          --
          Matt Kruse




          Comment

          • steveH

            #6
            Re: error creating XMLHttpRequest

            I would if I could, problem is, the issue only occurs for one
            particular user (that we know about - I assume there may be more that
            haven't reported it), and as Sods law dictates, it's an important user.
            I'm not going to be able to use him as a guinea pig, however simple the
            test.
            We have asked for full details of the browser, I can only hope that we
            can reproduce the problem if we can replicate the exact browser
            configuration.

            Comment

            • VK

              #7
              Re: error creating XMLHttpRequest

              I guess it's here: > new ActiveXObject(" Msxml2.XMLHTTP" ­);

              There is a confusion between the XML Parser (MSXML) and the primitive
              DataStream interface (Microsoft.XMLH TTP)

              The first one is a real library (msxml2.dll) that can be corrupted,
              missing or not registered.

              Microsoft.XMLHT TP is an internal call (there is not microsoft.dll), so
              "it's always here".

              If you do only primitive post/get operations with manual data handling,
              you don't need Msxml2 whatsoever (also on XP SP2 and later this is
              msxml3.dll - another possible cause of the problem).

              To help your client quickly with the minimum code change: simply
              inverse your branches (Microsoft.XMLH T­TP before Msxml2.XMLHTTP)

              Comment

              • Jim Ley

                #8
                Re: error creating XMLHttpRequest

                On 29 Jun 2005 05:54:10 -0700, "VK" <schools_ring@y ahoo.com> wrote:
                [color=blue]
                >Microsoft.XMLH TTP is an internal call (there is not microsoft.dll), so
                >"it's always here".[/color]

                No it's not!

                Jim.

                Comment

                • VK

                  #9
                  Re: error creating XMLHttpRequest

                  >No it's not!

                  Just switch the damn branches so Microsoft.XMLHT TP would go first; and
                  enjoy ever after (if still null, than the istallation of IE is badly
                  broken on the computer of the question).

                  My voice is not (at least not always) a voice of the evil.

                  Comment

                  • steveH

                    #10
                    Re: error creating XMLHttpRequest

                    if you look at the code, it's always going to try both progids before
                    it displays the error, so what do you expect switching the order to do,
                    exactly ?

                    Comment

                    • VK

                      #11
                      Re: error creating XMLHttpRequest

                      First of all, it works. If you can admit it, you may read below.
                      Otherwise please don't pull me in another religious discussion who's
                      God is better.

                      MSXML is *XML Parser*. Besides all other things it *may* work as a
                      server data reader, but it's not what it is done for.

                      Microsoft.XMLHT TP is a *low level server data reader* (as much as we
                      can talk about a *low level* in JavaScript).

                      To visualize the picture, think of a nail you need to put into the
                      wall; and a microscope and a hammer in front of you. So the question is
                      what will you take *first* from the table: the microscope (MSXML) or
                      the hammer (Microsoft.XMLH TTP). You can try to hammer the nail with the
                      microscope, but it also can fail apart during this operation. Or you
                      may use the hammer, which is the 100% guarantee (unless you smash your
                      fingers :-)

                      Comment

                      • Jim Ley

                        #12
                        Re: error creating XMLHttpRequest

                        On 30 Jun 2005 03:02:33 -0700, "VK" <schools_ring@y ahoo.com> wrote:
                        [color=blue]
                        >Microsoft.XMLH TTP is a *low level server data reader* (as much as we
                        >can talk about a *low level* in JavaScript).[/color]

                        We can't talk about any such thing... microsoft.xmlht tp and
                        msxml2.xmlhttp are not different in any way other than their age, and
                        the version they were installed in Microsoft.xmlht tp was implemented
                        in MSXML.dll and is old, MSXML2.XMLHTTP is implemented in MSXML2.dll
                        (or later) and is a bit newer. They're equivalent otherwise, please
                        try and understand what you're talking about, you might confuse
                        people.
                        [color=blue]
                        >To visualize the picture, think of a nail you need to put into the
                        >wall; and a microscope and a hammer in front of you. So the question is
                        >what will you take *first* from the table: the microscope (MSXML) or
                        >the hammer (Microsoft.XMLH TTP). You can try to hammer the nail with the
                        >microscope, but it also can fail apart during this operation. Or you
                        >may use the hammer, which is the 100% guarantee (unless you smash your
                        >fingers :-)[/color]

                        Except of course this analogy is complete garbage.

                        Jim.

                        Comment

                        • VK

                          #13
                          Re: error creating XMLHttpRequest

                          <http://support.microso ft.com/Default.aspx?id =893659>

                          *But I Was In The Dark Before*
                          *And Your God Is Better*

                          Please take this admission as an acceptable reason to not continue this
                          conversation.

                          Comment

                          Working...