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

Discussion in 'Javascript' started by RK, Jul 30, 2004.

  1. RK

    RK Guest

    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("POST", "test.aspx?qsVar="+qsVar, false);
    xmlhttp.setRequestHeader("Content-Type",
    "application/x-www-form-urlencoded");
    xmlhttp.Send(xmldoc);


    any help will be appreciated.

    RK
    RK, Jul 30, 2004
    #1
    1. Advertising

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

    RK wrote:

    > 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("POST", "test.aspx?qsVar="+qsVar, false);
    > xmlhttp.setRequestHeader("Content-Type",
    > "application/x-www-form-urlencoded");
    > xmlhttp.Send(xmldoc);
    >


    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/
    Martin Honnen, Jul 30, 2004
    #2
    1. Advertising

  3. RK

    Grant Wagner Guest

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

    RK wrote:

    > 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("POST", "test.aspx?qsVar="+qsVar, false);
    > xmlhttp.setRequestHeader("Content-Type",
    > "application/x-www-form-urlencoded");
    > xmlhttp.Send(xmldoc);
    >
    > any help will be appreciated.
    >
    > RK


    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 <>
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Grant Wagner, Jul 30, 2004
    #3
  4. RK

    Jim Ley Guest

    On 30 Jul 2004 08:34:46 -0700, (RK) wrote:

    >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("POST", "test.aspx?qsVar="+qsVar, false);
    > xmlhttp.setRequestHeader("Content-Type",
    >"application/x-www-form-urlencoded");
    > xmlhttp.Send(xmldoc);


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

    Jim.
    Jim Ley, Jul 30, 2004
    #4
  5. RK

    RK Guest

    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.dll 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(xmldoc) 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 Ley) wrote in message news:<>...
    > On 30 Jul 2004 08:34:46 -0700, (RK) wrote:
    >
    > >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("POST", "test.aspx?qsVar="+qsVar, false);
    > > xmlhttp.setRequestHeader("Content-Type",
    > >"application/x-www-form-urlencoded");
    > > xmlhttp.Send(xmldoc);

    >
    > This sounds like your server is rejecting it, and not realted to the
    > XMLHTTP object at all.
    >
    > Jim.
    RK, Aug 2, 2004
    #5
  6. RK

    Jim Ley Guest

    On 2 Aug 2004 07:14:12 -0700, (RK) wrote:

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


    sounds fine.

    >3) when it prompts "do u wish to debug the javascript error",


    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.
    Jim Ley, Aug 8, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John
    Replies:
    0
    Views:
    7,042
  2. Eric
    Replies:
    3
    Views:
    1,430
    Joerg Jooss
    Feb 27, 2007
  3. Lisa Ngo
    Replies:
    3
    Views:
    439
    Jan Tielens
    Jan 18, 2004
  4. rk325

    HTTP status 405: Method not allowed

    rk325, Dec 15, 2004, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    656
    Dan Rogers
    Dec 16, 2004
  5. Gerrit
    Replies:
    4
    Views:
    3,498
Loading...

Share This Page