473,609 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

RK
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
Jul 23 '05 #1
5 10979


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("P OST", "test.aspx?qsVa r="+qsVar, false);
xmlhttp.setRequ estHeader("Cont ent-Type",
"applicatio n/x-www-form-urlencoded");
xmlhttp.Send(xm ldoc);


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/

Jul 23 '05 #2
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("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


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 <gw*****@agrico reunited.com>
comp.lang.javas cript FAQ - http://jibbering.com/faq

Jul 23 '05 #3
On 30 Jul 2004 08:34:46 -0700, r_***********@y ahoo.com (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("P OST", "test.aspx?qsVa r="+qsVar, false);
xmlhttp.setRequ estHeader("Cont ent-Type",
"applicatio n/x-www-form-urlencoded");
xmlhttp.Send(xm ldoc);


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

Jim.
Jul 23 '05 #4
RK
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.

ji*@jibbering.c om (Jim Ley) wrote in message news:<41******* *******@news.in dividual.net>.. .
On 30 Jul 2004 08:34:46 -0700, r_***********@y ahoo.com (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("P OST", "test.aspx?qsVa r="+qsVar, false);
xmlhttp.setRequ estHeader("Cont ent-Type",
"applicatio n/x-www-form-urlencoded");
xmlhttp.Send(xm ldoc);


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

Jim.

Jul 23 '05 #5
On 2 Aug 2004 07:14:12 -0700, r_***********@y ahoo.com (RK) wrote:
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.
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.
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
12448
by: Dan Sikorsky | last post by:
Uploading from browser to server using Msxml2.XMLHTTP takes a long time about 15 minutes for a 1.5MB file at 37.2Kbps, although it does get there. Is there anyway to speed things up? here's the code ... var sFilename = (document.form1.myFileName.value); // create ADO-stream Object var ado_stream = new ActiveXObject("ADODB.Stream"); // create XML document with default header and primary node
17
14776
by: Patrick | last post by:
I am almost certain that I could use HTTP Post/Get to submit XML Web Service call (over SSL as well, if using Version 3 of MSXML2) from an ASP Application? However, would I only be able to call web-service in a an asynchronous mode (with a callback function)? If so, how?
1
8541
by: Eric | last post by:
I have a form with an INPUT type=file in it. I have another button that calls a function to exercise the oHTTP below. I think I need to open with the path of the CGI script on the server. What should the send have in it? oHTTP.open("POST", ??????????, false); oHTTP.send(????????????????????); Thanks.
2
21766
by: Michael Christensen | last post by:
Hi How do I send an input-param to my web service with MSXML2.ServerXMLHTTP? Can this be done without the soap-toolkit? Can't find anything about it - looking forward getting some help :-) ------------- Function GetLatest() Dim url, xmlhttp, XMLDOM, XMLNode
1
6567
by: Raúl Martín | last post by:
I´ve a function in asp that run correctly but If I tried to change it forasp.net in asp: xmlHTTP = CreateObject("Microsoft.XMLHTTP") And I thought to use this sentence for asp.net but the server don´t response right. xmlHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
2
8738
by: Maris Janis Vasilevskis | last post by:
Hi, Is it possible to force HttpWebRequest to do exactly (not approximately) the same as MSXML2.ServerXMLHTTP does? More details. I port JScript to JScript.NET I have a server (ASP invoking binary code; code not accessible). I send XML requests to it. If my request is accepted, ServerXMLHTTP returns XML with accept details. If my request is rejected, ServerXMLHTTP returns XML with reject details.
3
11292
by: BjörnHolmberg | last post by:
I'm trying to consume a WS from Excel (Office 98), seems that I can't send arguments into the WS. In order to pinpoint the problem I've written the following application i C# and VB6. It reproduces exaclty the same problem with less code. Any hints on how to solve this would be greatly appreciated. /Regards Björn The webservice is: using System; using System.Web.Services;
2
11294
by: noOby | last post by:
Hi developers, currently i'm doing a school project and i am stuck on MSXML2.XMLHTTP conversion from vb code to c#. Below is the vb Coding that i need to convert to C# Dim sUrl As String Dim xHttp As MSXML2.XMLHTTP
2
19189
by: Dave | last post by:
I am running the following code and I get an error: Set xmlHttp = Server.CreateObject("MSXML2.XMLHTTP.3.0") xmlHttp.Open "Get", URLToRSS, false xmlHttp.Send RSSXML = xmlHttp.ResponseText The error is: msxml3.dll error '800c0005'
0
8130
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8573
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8222
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8406
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7002
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4021
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.