Msxml2.XMLHTTP object's send method throwing HTTP /1.1 405 - Method not allowed error.

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

    #1

    Msxml2.XMLHTTP object's send method throwing HTTP /1.1 405 - Method not allowed error.

    I am getting the "HTTP /1.1 405 - method not allowed" error when I am
    sending XML string over Msxml2.XMLHTTP object. I am sending data in
    POST, also passing querystring variable and here is the code. Also
    error comes only sometimes.

    var xmlhttp = new ActiveXObject(" Msxml2.XMLHTTP" );
    xmlhttp.Open("P OST", "test.aspx?qsVa r="+qsVar, false);
    xmlhttp.setRequ estHeader("Cont ent-Type",
    "applicatio n/x-www-form-urlencoded");
    xmlhttp.Send(xm ldoc);


    any help will be appreciated.

    RK
  • Martin Honnen

    #2
    Re: Msxml2.XMLHTTP object's send method throwing HTTP /1.1 405 -Method not allowed error.



    RK wrote:
    [color=blue]
    > I am getting the "HTTP /1.1 405 - method not allowed" error when I am
    > sending XML string over Msxml2.XMLHTTP object. I am sending data in
    > POST, also passing querystring variable and here is the code. Also
    > error comes only sometimes.
    >
    > var xmlhttp = new ActiveXObject(" Msxml2.XMLHTTP" );
    > xmlhttp.Open("P OST", "test.aspx?qsVa r="+qsVar, false);
    > xmlhttp.setRequ estHeader("Cont ent-Type",
    > "applicatio n/x-www-form-urlencoded");
    > xmlhttp.Send(xm ldoc);
    >[/color]

    Check your web server configuration for that test.aspx, it will probably
    not allow POST requests thus you get the HTTP status error code/message
    for that case.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    • Grant Wagner

      #3
      Re: Msxml2.XMLHTTP object's send method throwing HTTP /1.1 405 - Methodnot allowed error.

      RK wrote:
      [color=blue]
      > I am getting the "HTTP /1.1 405 - method not allowed" error when I am
      > sending XML string over Msxml2.XMLHTTP object. I am sending data in
      > POST, also passing querystring variable and here is the code. Also
      > error comes only sometimes.
      >
      > var xmlhttp = new ActiveXObject(" Msxml2.XMLHTTP" );
      > xmlhttp.Open("P OST", "test.aspx?qsVa r="+qsVar, false);
      > xmlhttp.setRequ estHeader("Cont ent-Type",
      > "applicatio n/x-www-form-urlencoded");
      > xmlhttp.Send(xm ldoc);
      >
      > any help will be appreciated.
      >
      > RK[/color]

      What do the server logs say when you get the 405 error?

      I'm guessing that xmldoc probably has some invalid content in it.
      Obviously the first step in solving this is to try and create a reliably
      reproducible test case. Once you can reliably reproduce the problem, you
      can examine the content of qsVar and xmldoc to ensure they contain valid
      values and check the server logs to determine what exactly is going
      wrong.

      --
      Grant Wagner <gwagner@agrico reunited.com>
      comp.lang.javas cript FAQ - http://jibbering.com/faq

      Comment

      • Jim Ley

        #4
        Re: Msxml2.XMLHTTP object's send method throwing HTTP /1.1 405 - Method not allowed error.

        On 30 Jul 2004 08:34:46 -0700, r_adhakrishna@y ahoo.com (RK) wrote:
        [color=blue]
        >I am getting the "HTTP /1.1 405 - method not allowed" error when I am
        >sending XML string over Msxml2.XMLHTTP object. I am sending data in
        >POST, also passing querystring variable and here is the code. Also
        >error comes only sometimes.
        >
        > var xmlhttp = new ActiveXObject(" Msxml2.XMLHTTP" );
        > xmlhttp.Open("P OST", "test.aspx?qsVa r="+qsVar, false);
        > xmlhttp.setRequ estHeader("Cont ent-Type",
        >"applicatio n/x-www-form-urlencoded");
        > xmlhttp.Send(xm ldoc);[/color]

        This sounds like your server is rejecting it, and not realted to the
        XMLHTTP object at all.

        Jim.

        Comment

        • RK

          #5
          Re: Msxml2.XMLHTTP object's send method throwing HTTP /1.1 405 - Method not allowed error.

          first of all thanks for the responses,

          I checked up the following things..

          1) Default website on the webserver, .aspx is mapped to
          aspnet_isapi.dl l with GET, HEAD, POST, DEBUG verbs. I assume the same
          is propagated to virtual directories under default web site.

          2) I checked xmldoc in xmlhttp.send(xm ldoc) method in debug mode, the
          xml string is fine.

          3) when it prompts "do u wish to debug the javascript error", and when
          I select yes, and see the values in debug window, then stop the
          debugger, and select no on the javascript error prompt, that lets this
          method to go without error.





          jim@jibbering.c om (Jim Ley) wrote in message news:<410accf3. 5984455@news.in dividual.net>.. .[color=blue]
          > On 30 Jul 2004 08:34:46 -0700, r_adhakrishna@y ahoo.com (RK) wrote:
          >[color=green]
          > >I am getting the "HTTP /1.1 405 - method not allowed" error when I am
          > >sending XML string over Msxml2.XMLHTTP object. I am sending data in
          > >POST, also passing querystring variable and here is the code. Also
          > >error comes only sometimes.
          > >
          > > var xmlhttp = new ActiveXObject(" Msxml2.XMLHTTP" );
          > > xmlhttp.Open("P OST", "test.aspx?qsVa r="+qsVar, false);
          > > xmlhttp.setRequ estHeader("Cont ent-Type",
          > >"applicatio n/x-www-form-urlencoded");
          > > xmlhttp.Send(xm ldoc);[/color]
          >
          > This sounds like your server is rejecting it, and not realted to the
          > XMLHTTP object at all.
          >
          > Jim.[/color]

          Comment

          • Jim Ley

            #6
            Re: Msxml2.XMLHTTP object's send method throwing HTTP /1.1 405 - Method not allowed error.

            On 2 Aug 2004 07:14:12 -0700, r_adhakrishna@y ahoo.com (RK) wrote:
            [color=blue]
            >1) Default website on the webserver, .aspx is mapped to
            >aspnet_isapi.d ll with GET, HEAD, POST, DEBUG verbs. I assume the same
            >is propagated to virtual directories under default web site.[/color]

            sounds fine.
            [color=blue]
            >3) when it prompts "do u wish to debug the javascript error",[/color]

            but it shouldn't do this if it's a METHOD NOT ALLOWED error, that's
            not a javascript one.

            Could you maybe put the page online so we could have a look?

            Jim.

            Comment

            Working...