SOAP Fault: operation description is missing parameter!

1,287 views
Skip to first unread message

svet

unread,
Sep 23, 2005, 4:09:11 AM9/23/05
to AdWords API Forum
Please someone can help me. With the attempt a Creativesobjekt to
produce I get the following error message:

SOAP Fault: org.xml.sax.SAXException: operation description is missing
parameter
description! for input "" (Error Code )...

Property already verschidene variant of display URL and destinationUrl
tries. None strikes.


Here those is code:

use SOAP::Lite;
use strict;
use warnings;
use URI::Escape;

my $email = "...\@....de";
my $password = "...";
my $useragent = "Adwords API";
my $token = "...";
my $namespace = "https://adwords.google.com/api/adwords/v2";

my @headers =

(SOAP::Header->name("email")->value($email)->uri($namespace)->prefix("impl"),

SOAP::Header->name("password")->value($password)->uri($namespace)->prefix("impl"),

SOAP::Header->name("useragent")->value($useragent)->uri($namespace)->prefix("impl"),

SOAP::Header->name("token")->value($token)->uri($namespace)->prefix("impl"));

my $url =
"https://adwords.google.com/api/adwords/v2/CreativeService?WSDL";

my $service = SOAP::Lite->service($url);

$service->autotype(0);

$service->on_fault(\&faulthandler);

my $adgrid=XXXXXXXX;

my $creative1 = {
'headline' => 'Creative Headline',
'description1' => 'Line 1',
'description2' => 'Line 2',

'displayUrl' => 'www.example.com',
'destinationUrl' => 'http://www.example.com'

#'displayUrl' => 'www\.example\.com',
#'destinationUrl' => 'http://www\.example\.com'

#'displayUrl' => 'www\.example\.com',
#'destinationUrl' => uri_escape('http://www.example.com')

#'displayUrl' => SOAP::Data->name(displayUrl
=>'http://example\.com/'),
#'destinationUrl' => SOAP::Data->name(destinationUrl
=>'http://www\.example\.com')


#SOAP::Data->name('displayUrl')->value('http://example\.com/')->type('xsd:string'),


#SOAP::Data->name('destinationUrl')->value('http://www\.example\.com')->type('xsd:string')

#SOAP::Data->name('displayUrl')->value('http://example\.com/'),

#SOAP::Data->name('destinationUrl')->value('http://www\.example\.com')
};

my @args = [ $creative1 ];

my @creatives = $service->addCreativeList($adgrid, @args, @headers);

foreach my $c (@creatives) {
print "Creative " . $c->{"id"} . " has headline '" .
$c->{"headline"} . "'\n";
}


### Helper functions

sub faulthandler {
my ($soap, $res) = @_;
die("SOAP Fault: " . $res->faultstring . " for input \"" .
$res->faultdetail->{"trigger"} .
"\" (Error Code " . $res->faultdetail->{"code"} . ")");
}


It must be nevertheless relatively simple to solve. Does someone have
reference? Thanks.

Patrick Chanezon

unread,
Sep 23, 2005, 6:10:16 AM9/23/05
to svet, AdWords API Forum
Hi Svet,
the problem you encounter is because you pass the AdGroupId as a parameter to addCreativeList instead of sticking it in the Creative hash.
There is a Perl sample in the sample section of the AdWords Developer web site that shows how to add a creative:
http://www.google.com/apis/adwords/samples/perl/addcreatives.pl.txt

 Going back to your code, I show how you should fix it below.

I hope this helps.

P@


'adGroupId' => $adgrid,
 

  'headline' => 'Creative Headline',
  'description1' => 'Line 1',
  'description2' => 'Line 2',

  'displayUrl' => 'www.example.com',
  'destinationUrl' => 'http://www.example.com '

  #'displayUrl' => 'www\.example\.com',
  #'destinationUrl' => 'http://www\.example\.com'

  #'displayUrl' => 'www\.example\.com',
  #'destinationUrl' => uri_escape(' http://www.example.com')

  #'displayUrl' => SOAP::Data->name(displayUrl
=>'http://example\.com/'),
  #'destinationUrl' => SOAP::Data->name(destinationUrl
=>'http://www\.example\.com')


#SOAP::Data->name('displayUrl')->value('http://example\.com/')->type('xsd:string'),


#SOAP::Data->name('destinationUrl')->value('http://www\.example\.com')->type('xsd:string')

  #SOAP::Data->name('displayUrl')->value(' http://example\.com/'),

#SOAP::Data->name('destinationUrl')->value('http://www\.example\.com')
};

my @args = [ $creative1 ];

my @creatives = $service->addCreativeList($adgrid, @args, @headers);

my @creatives = $service->addCreativeList(@args, @headers);
 

foreach my $c (@creatives) {
    print "Creative " . $c->{"id"} . " has headline '" .
$c->{"headline"} . "'\n";
}


### Helper functions

sub faulthandler {
  my ($soap, $res) = @_;
  die("SOAP Fault: " . $res->faultstring . " for input \"" .
      $res->faultdetail->{"trigger"} .
      "\" (Error Code " . $res->faultdetail->{"code"} . ")");
}


It must be nevertheless relatively simple to solve.  Does someone have
reference?  Thanks.




--
Patrick Chanezon, AdWords API evangelist
http://blog.chanezon.com/
http://www.google.com/apis/adwords/

svet

unread,
Sep 23, 2005, 9:20:15 AM9/23/05
to AdWords API Forum
Thank you. It functions.

Reply all
Reply to author
Forward
0 new messages