I got following error message: HTTP method POST is not supported by this URL

1,518 views
Skip to first unread message

JH

unread,
Mar 14, 2005, 6:03:01 PM3/14/05
to adwor...@googlegroups.com
Hello all,

I got following error message when I was trying to connect with
google's adword web service by using XML

- <HTML>
- <HEAD>
<TITLE>HTTP method POST is not supported by this URL</TITLE>
</HEAD>
- <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>HTTP method POST is not supported by this URL</H1>
<H2>Error 405</H2>
</BODY>
</HTML>

I was sending the following message to google:

- <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns="https://adwords.google.com/api/adwords/v2">
- <soap:Header>
<email>myemail</email>
<password>mypassword</password>
<token>mytoken</token>
</soap:Header>
- <soap:Body>
- <estimateKeywordList>
- <keywordRequests>
<type>Broad</type>
<text>flowers</text>
<maxCpc>5000</maxCpc>
</keywordRequests>
</estimateKeywordList>
</soap:Body>
</soap:Envelope>

Anybody has similar experience? Thanks in advance.

JH

Whaler

unread,
Mar 15, 2005, 3:22:29 AM3/15/05
to adwor...@googlegroups.com
what address do you connect to?

Jason H

unread,
Mar 15, 2005, 10:40:21 AM3/15/05
to Whaler, adwor...@googlegroups.com

Whaler

unread,
Mar 15, 2005, 11:07:44 AM3/15/05
to adwor...@googlegroups.com

JH

unread,
Mar 15, 2005, 12:43:17 PM3/15/05
to adwor...@googlegroups.com
Hi Whaler,

Thanks for your help for the previous error. I got another error now,
the message said no SOAPAction header. I think I did include soap
header in my code, so not sure what does that mean. The following is
the exact message:

- <soapenv:Fault>
<faultcode
xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode>

<faultstring>no SOAPAction header!</faultstring>
<detail />
</soapenv:Fault>

Any similar experience,

Thanks

JH

AdWordsAPIAdvisor

unread,
Mar 15, 2005, 3:44:02 PM3/15/05
to adwor...@googlegroups.com
Hi JH --

You need a SOAPAction header in your HTTP. Its value can be an empty
string. E.g.:

POST https://adwords.google.com/api/adwords/v2/TrafficEstimatorService
SOAPAction:

[XML]

-- Brian Kennish, Google

mrjonman

unread,
Mar 17, 2005, 1:26:02 AM3/17/05
to adwor...@googlegroups.com
Hi Brian

I'm having the same problem. I'm using Microsoft XML, ver 4.0 in a VB6
(SP6) app. I don't know how to declare the SOAPAction header in the
MSXML2.XMLHTTP40 object

My code results in the same error, "no SOAPAction header!".

Dim objHTTP As New MSXML2.XMLHTTP40
objHTTP.open "post",
"https://adwords.google.com/api/adwords/v2/TrafficEstimatorService",
False
objHTTP.setRequestHeader "Content-Type", "text/xml"
objHTTP.setRequestHeader "estimateKeywordList",
"https://adwords.google.com/api/adwords/v2/TrafficEstimatorService"
objHTTP.send strEnvelope

Suggestions?

Thanks

John

DA

unread,
Mar 17, 2005, 10:33:34 AM3/17/05
to adwor...@googlegroups.com
For all using HTTP POST. Below is an example of setting the service and
Request Header.

ObjHTTP.Open - This is ther service URL. The below example is the
CampaignService.

ObjHTTP.SetRequestHeader - is the SOAPAction header. Google has said
this can be null but it did not work for me. I have been setting it to
"x" and has worked all all services so far.

ObjHTTP.Send(SoapXML) - Send, SoapXML should be your soap envelope
with your reqest in the soap body.

ObjHTTP.ResponseText - This returns the response in XML. You must parse
the XML yourself

EXAMPLE
ObjHTTP.Open("POST ",
"https://adwords.google.com/api/adwords/v2/CampaignService", "False")
ObjHTTP.SetRequestHeader("SOAPAction", "x")
ObjHTTP.Send(SoapXML)
x = ObjHTTP.ResponseText

wrestler

unread,
Apr 6, 2005, 4:21:35 PM4/6/05
to adwor...@googlegroups.com
Is there any way to do this without using MSXML? I am using Xerces from
Apache. For XML we just POST the data via CHttpConnection.

Reply all
Reply to author
Forward
0 new messages