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
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
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
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
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