I have the following problem:
I developed a program, which uses the Google API. The program is in
the test phase and ever is continued to improve.
For 2 days I can test the program suddenly not further, there I when
putting on or change a campaign SOAP error of wars:
>>>
SOAP Fault: An internal error has occurred. Please retry your request.
for input "" (Error Code 0)...
<<<
It is limited only to campaign level.
Changes search words and the announcements go through easily.
Still assure to the fact that in the program for a long time nothing
more one changed, which concerns campaign level.
Does someone have an idea, which that could be?
Thanks ahead.
I'm afraid that no one really knows what this error means. At a guess
it is probably means there was an assertion failure in Google's code.
Retrying often doesn't help either. What you should do is to post the
original XML of the SOAP request here, and we can then look for any
obvious errors.
Rich.
--
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com
Here is the original XML of the SOAP:
>>>
POST https://adwords.google.com/api/adwords/v2/CampaignService HTTP/1.1
Accept: text/xml
Accept: multipart/*
Content-Length: 1352
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://
schemas.xmlsoap.org/soap/envelope/"
xmlns:namesp6="http://namespaces.soaplite.co
m/perl" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="ht
tp://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/1999/XMLSc
hema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-E
NV:Header><namesp1:email
xmlns:namesp1="https://adwords.google.com/api/adwords/v
2">xxxxxx</namesp1:email><namesp2:password xmlns:namesp2="https://adwo
rds.google.com/api/adwords/v2">xxxxxx</namesp2:password><namesp3:useragent
xmln
s:namesp3="https://adwords.google.com/api/adwords/v2">Adwords
API</namesp3:usera
gent><namesp4:token
xmlns:namesp4="https://adwords.google.com/api/adwords/v2">xx
xxxxxxxxxxxxxxxxxxx</namesp4:token></SOAP-ENV:Header><SOAP-ENV:Body><namesp5:ad
dCampaign
xmlns:namesp5="https://adwords.google.com/api/adwords/v2"><parameters
xsi:type="namesp6"><languageTargeting><languages>en</languages><languages>de</la
nguages></languageTargeting><dailyBudget>3100000</dailyBudget><geoTargeting><cou
ntries>DE</countries></geoTargeting><endDate>2006-03-17T00:00:00</endDate><statu
s>Active</status><name>campaign1</name><startDate>2006-01-18T00:00:00</startDate
></parameters></namesp5:addCampaign></SOAP-ENV:Body></SOAP-ENV:Envelope>
HTTP/1.1 500 Internal Server Error
Cache-Control: private
Connection: Close
Date: Wed, 18 Jan 2006 12:25:56 GMT
Server: GFE/1.3
Content-Type: text/xml; charset=utf-8
Client-Date: Wed, 18 Jan 2006 12:25:56 GMT
Client-Peer: 64.233.183.112:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /C=ZA/ST=Western Cape/L=Cape Town/O=Thawte
Consulting cc
/OU=Certification Services Division/CN=Thawte Premium Server
CA/emailAddress=pre
mium-...@thawte.com
Client-SSL-Cert-Subject: /C=US/ST=California/L=Mountain View/O=Google
Inc/CN=adw
ords.google.com
Client-SSL-Cipher: AES256-SHA
Client-SSL-Warning: Peer certificate not verified
Client-Transfer-Encoding: chunked
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmln
s:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSc
hema-instance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.generalExc
eption</faultcode><faultstring>An internal error has occurred. Please
retry you
r request.</faultstring><detail><ns1:code
xmlns:ns1="https://adwords.google.com/
api/adwords/v2">0</ns1:code><ns2:message
xmlns:ns2="https://adwords.google.com/a
pi/adwords/v2">An internal error has occurred. Please retry your
request.</ns2:
message></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
SOAP Fault: An internal error has occurred. Please retry your request.
for inpu
t "" (Error Code 0)...
<<<
Possibly it is important: I got the described SOAP errors, after I set
the final date of the campaign, which had status "Ended", with the test
attempt in the future. Thus this campaign was again asset (status
"Active") and final date changed on the future one, which actually
should not be.
It looks like this request was generated by SOAP::Lite, the version
which doesn't understand document/literal encoding. SOAP is a really
screwed up standard which exists in several incompatible formulations.
The one which Google use is the really complicated one based on WSDL
files and XSI schemas. Parsing these schemas properly and generating
proper SOAP requests is a nightmare, and one which SOAP::Lite doesn't
really do right.
Anyway, in the example you give above there are some obvious problems:
The node inside <addCampaign> should be a list of <campaign> elements.
All the nodes inside <addCampaign> should be prefixed with the right
namespace (eg. <namesp5:dailyBudget>). The xsi:type of <parameters>
looks wrong to me, although this might be some usage of xsi:type which
I'm not familiar with.
> Possibly it is important: I got the described SOAP errors, after I set
> the final date of the campaign, which had status "Ended", with the test
> attempt in the future. Thus this campaign was again asset (status
> "Active") and final date changed on the future one, which actually
> should not be.
If you don't set the end date for your new campaigns (which we never
do), then Google allocates a date far in the future, some time in 2011
IIRC. So you could certainly try not setting a start or end dates.
There is also a small problem with the format of those dates, although
it might not be significant. The format should be:
2006-01-18T00:00:00.000Z
Thank you for detailed XML Analise.
Unfortunately does not help me.
I tested the program again and tried a campaign to put on, without
indicating final date and/or starting date. It caused the SOAP error
again and again:
SOAP Fault: java.lang.NumberFormatException: Invalid date/time for
input "" (Error Code)...
Then I experimented with the format of date (times so
2006-01-19t00:00:00.000z, times so 2006-01-19t00:00:00). Everything in
vain. I got there same SOAP error as early:
SOAP Fault: An internal error has occurred. Please retry your request.
for input "" (Error Code 0)...
How do I create nevertheless this problem from that world?
Am I to turn to Google support?
Perhaps still does someone have an idea?
Thanks ahead
This is another problem. Are you sending <startDate></startDate>?
You should omit the dates entirely.
Here small is test cutout from my program. Like you will see, it
hardly differs from the your example.
-----------------------------
#!perl
use SOAP::Lite;
use strict;
use warnings;
my $email = "xxx\@xxx.de ";
my $password = "xxxxxxxx";
my $useragent = "Adwords API";
my $token = "xxxxxxxxxxxxxxx";
my $namespace = "https://adwords.google.com/api/adwords/v2";
my @headers =
(SOAP::Header->name("email")->value($email)->uri($namespace),
SOAP::Header->name("password")->value($password)->uri($namespace),
SOAP::Header->name("useragent")->value($useragent)->uri($namespace),
SOAP::Header->name("token")->value($token)->uri($namespace));
my $url =
"https://adwords.google.com/api/adwords/v2/CampaignService?WSDL";
my $service = SOAP::Lite->service($url);
$service->autotype(0);
$service->on_fault(\&fault_handler);
$service->on_debug( sub { print @_ } );
my $campaignname='testcampaign';
my $status='Active';
#my $startDat='2006-01-21T00:00:00';
#my $endDat='2006-03-17T00:00:00';
my $dailyBudg='3000000';
my $language='de';
my $countrie='DE';
my $campaign = {
'name'=> $campaignname,
'status' => $status,
#'startDate' => $startDat,
#'endDate' => $endDat,
'dailyBudget' => $dailyBudg,
'languageTargeting' => \SOAP::Data->name('languages')->value("en",
$language),
'geoTargeting' => { "countries" => $countrie },
};
my $data = $service->addCampaign($campaign, @headers);
sub fault_handler {
my ($soap, $res) = @_;
die("SOAP Fault: " . $res->faultstring . " for input \"" .
$res->faultdetail->{"trigger"} .
"\" (Error Code " . $res->faultdetail->{"code"} . ")");
}
-----------------------------
And there is still times the XML code for it:
-----------------------------
POST https://adwords.google.com/api/adwords/v2/CampaignService HTTP/1.1
Accept: text/xml
Accept: multipart/*
Content-Length: 1275
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://
schemas.xmlsoap.org/soap/envelope/"
xmlns:namesp6="http://namespaces.soaplite.co
m/perl" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="ht
tp://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/1999/XMLSc
hema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-E
NV:Header><namesp1:email
xmlns:namesp1="https://adwords.google.com/api/adwords/v
2"> xxx\@xxx.de </namesp1:email><namesp2:password
xmlns:namesp2="https://adwo
rds.google.com/api/adwords/v2">
xxxxxxxx</namesp2:password><namesp3:useragent xmln
s:namesp3="https://adwords.google.com/api/adwords/v2">Adwords
API</namesp3:usera
gent><namesp4:token
xmlns:namesp4="https://adwords.google.com/api/adwords/v2">xx
xxxxxxxxxxxxx
</namesp4:token></SOAP-ENV:Header><SOAP-ENV:Body><namesp5:ad
dCampaign
xmlns:namesp5="https://adwords.google.com/api/adwords/v2"><parameters
xsi:type="namesp6"><languageTargeting><languages>en</languages><languages>de</la
nguages></languageTargeting><dailyBudget>3000000</dailyBudget><geoTargeting><cou
ntries>DE</countries></geoTargeting><status>Active</status><name>testcampaign</n
ame></parameters></namesp5:addCampaign></SOAP-ENV:Body></SOAP-ENV:Envelope>
HTTP/1.1 500 Internal Server Error
Cache-Control: private
Connection: Close
Date: Fri, 20 Jan 2006 09:03:54 GMT
Server: GFE/1.3
Content-Type: text/xml; charset=utf-8
Client-Date: Fri, 20 Jan 2006 09:03:54 GMT
SOAP Fault: An internal error has occurred. Please retry your request.
for inpu
t "" (Error Code 0) at test_campaign.pl line 52.
SOAP Fault: An internal error has occurred. Please retry your request.
for inpu
t "" (Error Code 0) at test_campaign.pl line 52.
-----------------------------
In addition it is to be said that we use SOAP-Lite-0.60.
Since SOAP error suddenly arose, without which I changed something in
my program, resist it to assume correctly that the error lies in that I
experimented with the terminated campaign (see higher)?
With further test with addCampaign() I determined the following:
If I get date completely discharge opening, I error message:
>>>
SOAP Fault: An internal error has occurred. Please retry your request.
for input "" (Error Code 0)...
If I start (und end -) date indicates, gets I error message:
>>>
SOAP Fault: java.lang.NumberFormatException: Unexpected characters for
input "" (Error Code )...
Format of date looks with me in such a way: 2006-01-26T12:46:03.000z,
how it is to look nevertheless, or?
Does someone know, where possibly the error lies?
Thanks ahead.