Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Msxml2.XMLHTTP object's send method throwing HTTP /1.1 405 - Method not allowed error.

Reply
Thread Tools

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

 
 
RK
Guest
Posts: n/a
 
      07-30-2004
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
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      07-30-2004


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/

 
Reply With Quote
 
 
 
 
Grant Wagner
Guest
Posts: n/a
 
      07-30-2004
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 <(E-Mail Removed)>
comp.lang.javascript FAQ - http://jibbering.com/faq

 
Reply With Quote
 
Jim Ley
Guest
Posts: n/a
 
      07-30-2004
On 30 Jul 2004 08:34:46 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) (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.
 
Reply With Quote
 
RK
Guest
Posts: n/a
 
      08-02-2004
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.





(E-Mail Removed) (Jim Ley) wrote in message news:<(E-Mail Removed)>...
> On 30 Jul 2004 08:34:46 -0700, (E-Mail Removed) (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.

 
Reply With Quote
 
Jim Ley
Guest
Posts: n/a
 
      08-08-2004
On 2 Aug 2004 07:14:12 -0700, (E-Mail Removed) (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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SOAP request returns with HTTP/1.1 405 Method not allowed Gerrit ASP .Net Web Services 4 09-13-2012 08:29 AM
Http Post error (405) Method Not Allowed. Eric ASP .Net 3 02-27-2007 09:55 PM
HTTP 405 - Resource not allowed =?Utf-8?B?U3RldmVXZXN0bGluZw==?= ASP .Net 0 11-25-2005 08:19 PM
HTTP status 405: Method not allowed rk325 ASP .Net Web Services 3 12-16-2004 07:05 PM
System.Net.WebException occurred in system.web.services.dll - HTTP status 405: Method not allowed. Lisa Ngo ASP .Net Web Services 3 01-18-2004 10:55 AM



Advertisments