Getting NoSOAPAction Error

747 views
Skip to first unread message

Diwakar

unread,
Sep 17, 2009, 10:05:34 PM9/17/09
to AdWords API Forum
I just started working on AdWords API.

I am using the following SOAP request to retrieve all campaigns in
sand box environment.

<?xml version="1.0"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header>
<applicationToken>XXXXXXXXXXXXXXXX</applicationToken>
<password>XXXXXXXXX</password>
<email>XXXXXX...@gmail.com</email>
<clientEmail>client_1...@gmail.com</clientEmail>
<useragent>XXXXX</useragent>
<developerToken>XXXX...@gmail.com++USD</developerToken>
</env:Header>
<env:Body>
<getAllAdWordsCampaigns>
<dummy>0</dummy>
</getAllAdWordsCampaigns>
</env:Body>
</env:Envelope>

The following are the headers that are being set before sending the
request in Visual Basic using XMLHttp object:

objHTTP.Open "POST", "https://sandbox.google.com/api/adwords/v13/
CampaignService", False

objHTTP.setRequestHeader "Content-Type", "text/xml"
objHTTP.setRequestHeader "Connection", "open"
objHTTP.setRequestHeader "SOAPAction", ""

objHTTP.send soap_request

I am getting the following response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode xmlns:ns1="http://xml.apache.org/
axis/">ns1:Client.NoSOAPAction</faultcode>
<faultstring>no SOAPAction header!</faultstring>
<detail/>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

I did not find much help on groups regarding this error. I would
appreciate your help in figuring out what the problem is?

AdWords API Advisor

unread,
Sep 18, 2009, 2:52:55 PM9/18/09
to AdWords API Forum
Hi Diwakar,

The SOAP 1.1 specification lists SOAPAction as a required field:
http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383528. The
AdWords API servers don't validate the value of the header, but it
must have a value. The common convention is to set the value to a
pair of double quotes:

SOAPAction: ""

Your code is currently setting the value to an empty string, which
will result in:

SOAPAction:

As a general aside, rather than handling SOAP messages directly I
would recommend using a SOAP toolkit, like that provided by Visual
Studio. We also provide a .NET client library that has many other
features built in: http://code.google.com/p/google-api-adwords-dotnet/.

Best,
- Eric Koleda, AdWords API Team


On Sep 17, 7:05 pm, Diwakar <diwakar.raj...@gmail.com> wrote:
> I just started working on AdWords API.
>
> I am using the following SOAP request to retrieve all campaigns in
> sand box environment.
>
> <?xml version="1.0"?>
> <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>   <env:Header>
>     <applicationToken>XXXXXXXXXXXXXXXX</applicationToken>
>    <password>XXXXXXXXX</password>
>     <email>XXXXXXXXXX...@gmail.com</email>
>     <clientEmail>client_1+XXXX...@gmail.com</clientEmail>
>     <useragent>XXXXX</useragent>
>     <developerToken>XXXXXX...@gmail.com++USD</developerToken>

Diwakar

unread,
Sep 19, 2009, 12:32:22 AM9/19/09
to AdWords API Forum
Hi Eric,
Thanks for your response. The problem is solved now.

As our present application cannot access any external resources, we
cannot use SOAP toolkit. We need to go with only XMLHttp Object. Can
you foresee any kind of potential problem if we don't use any SOAP
toolkit in our application?

-Diwakar

On Sep 18, 11:52 pm, AdWords API Advisor

AdWords API Advisor

unread,
Sep 21, 2009, 10:28:10 AM9/21/09
to AdWords API Forum
Hi Diwakar,

I don't believe you will encounter any major problems from not using a
SOAP toolkit, but generating the SOAP messages by hand will require
you to pay extra attention to the details. For example, in v2009 when
you set the bidding strategy of a campaign, you don't assign a value
to the element but instead set it's XSI type:

<biddingStrategy xsi:type="ManualCPC" />

Some of these methodologies aren't immediately obvious, but are
handled automatically by out client libraries and various SOAP
toolkits.

Best,
- Eric
Reply all
Reply to author
Forward
0 new messages