473,395 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

MSXML problems keeps returning 400 when POST

I keep getting a server error 400 - Bad Request with the code below.

xmlDoc is the MSXML.DOMDocument populated with the xml data to submit. That
data is well formed and works fine if I urlencode it and send it via a GET
instead of POST. It also prints out nice if I simply send it out so I know
thats not the issue. No matter what I put in there or if I add the data from
the document into a querystring nothing works. I am assuming that it is my
web server that doesn't like something but can't for the life of me figure
out what.

What I have tried to change

1. alter the url to include querystring data and simply call send with no
content
2. removing the ? from the url
3. adding the xml content header to the string being sent
4. changing the setRequestHeader to "application/x-www-form-urlencoded"
5. submiting nothing to see if the remote server will at least return an
error
6. using xmlDoc.xml to place content in send

I am ready to pull my hair out here I have not had a single "POST" work only
the "GET" method. (actually that seems now to have discontinued working)

strURL = "http://testing.shippingapis.com/ShippingAPItest.dll?"

Set xmlServer = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlServer.Open "POST", strURL, False
xmlServer.setRequestHeader "content-type", "text/xml"
xmlServer.Send(xmlDoc)

Jul 19 '05 #1
2 3788
Are you sure that the DLL is expecting a POST rather than a GET?

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Jason Burr" <jb***@tameinfo.com> wrote in message
news:KG*********************@news1.news.adelphia.n et...
I keep getting a server error 400 - Bad Request with the code below.

xmlDoc is the MSXML.DOMDocument populated with the xml data to submit. That data is well formed and works fine if I urlencode it and send it via a GET
instead of POST. It also prints out nice if I simply send it out so I know
thats not the issue. No matter what I put in there or if I add the data from the document into a querystring nothing works. I am assuming that it is my
web server that doesn't like something but can't for the life of me figure
out what.

What I have tried to change

1. alter the url to include querystring data and simply call send with no
content
2. removing the ? from the url
3. adding the xml content header to the string being sent
4. changing the setRequestHeader to "application/x-www-form-urlencoded"
5. submiting nothing to see if the remote server will at least return an
error
6. using xmlDoc.xml to place content in send

I am ready to pull my hair out here I have not had a single "POST" work only the "GET" method. (actually that seems now to have discontinued working)

strURL = "http://testing.shippingapis.com/ShippingAPItest.dll?"

Set xmlServer = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlServer.Open "POST", strURL, False
xmlServer.setRequestHeader "content-type", "text/xml"
xmlServer.Send(xmlDoc)

Jul 19 '05 #2
Yes it actually accepts either. I did get it worked out the post doesnt
actually accept an xml post but a urlencoded post of the xml data.

Rather than the xmlServer.Send(xmlDoc) its
xmlServer.Send(strThatsBeenURLEncoded)

The 400 error is actually the data that was returned from thier server. That
was a pain to figure out. Had to point the url to another site and see that
it was redirected on that site.

Thanks for your response.
"Mark Schupp" <ms*****@ielearning.com> wrote in message
news:Ov**************@TK2MSFTNGP11.phx.gbl...
Are you sure that the DLL is expecting a POST rather than a GET?

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Jason Burr" <jb***@tameinfo.com> wrote in message
news:KG*********************@news1.news.adelphia.n et...
I keep getting a server error 400 - Bad Request with the code below.

xmlDoc is the MSXML.DOMDocument populated with the xml data to submit.

That
data is well formed and works fine if I urlencode it and send it via a GET instead of POST. It also prints out nice if I simply send it out so I know thats not the issue. No matter what I put in there or if I add the data

from
the document into a querystring nothing works. I am assuming that it is my web server that doesn't like something but can't for the life of me figure out what.

What I have tried to change

1. alter the url to include querystring data and simply call send with no content
2. removing the ? from the url
3. adding the xml content header to the string being sent
4. changing the setRequestHeader to "application/x-www-form-urlencoded"
5. submiting nothing to see if the remote server will at least return an
error
6. using xmlDoc.xml to place content in send

I am ready to pull my hair out here I have not had a single "POST" work

only
the "GET" method. (actually that seems now to have discontinued working)

strURL = "http://testing.shippingapis.com/ShippingAPItest.dll?"

Set xmlServer = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlServer.Open "POST", strURL, False
xmlServer.setRequestHeader "content-type", "text/xml"
xmlServer.Send(xmlDoc)


Jul 19 '05 #3

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

Similar topics

1
by: OKI | last post by:
Hi. I´ve made a XML parser using MSXML2.LIB in a computer. When i´ve tried to run it in another one like that: HRESULT hr = CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,...
6
by: Alfred Taylor | last post by:
I'm having performance/memory problems using .NET's XslTransform class so I thought I'd give the MSXML object's a whirl. The question I haven't been able to find in these groups is can I use C#...
10
by: BBFrost | last post by:
We just recently moved one of our major c# apps from VS Net 2002 to VS Net 2003. At first things were looking ok, now problems are starting to appear. So far ... (1) ...
4
by: K | last post by:
I've an XML file in UTF-8. It contains some chinese characters ( both simplified chinese and traditional chinese). In loading the XML file with MSXML parser, I used the below code to retrieve...
0
by: upendra.desai | last post by:
Hi, I have written an application in Microsoft Visual C++ (Visual Studio 6.0) that uses MSXML 4.0 SP2. When I try to load an XML from a file, it throws an E_ACCESSDENIED (HRESULT = 0x80070005)...
0
by: upendra.desai | last post by:
Hi, I have written an application in Microsoft Visual C++ (Visual Studio 6.0) that uses MSXML 4.0 SP2. When I try to load an XML from a file, it throws an E_ACCESSDENIED (HRESULT = 0x80070005)...
0
by: MLH | last post by:
In the following code snippet, notice ("PIN=1234567890&MSSG=Here+is+a+short+message+-+no+spaces+-+just+plusses&Q1=0") I have it that way because I thought PLUSes were required and that spaces...
19
by: Matthias Truxa | last post by:
Hello, can anyone confirm the existence of the following effects which I'd consider being a critical bug in msxml according to w3c's xpath specs? The Spec says: "The parent, ancestor,...
0
Carrugar
by: Carrugar | last post by:
Hi folks, was hoping someone might have some suggestions to a major PITA problem I'm having! I have a function below which resides in an ASP file. It creates a URL using the strParams variable...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...

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.