Unmarshalling Error ? CampaignService v2009

36 views
Skip to first unread message

Exiges

unread,
Jul 28, 2009, 7:50:47 PM7/28/09
to AdWords API Forum
I'm trying to use the latest Perl library for the v200906 API (http://
google-api-adwords-perl.googlecode.com/files/
awapi_perl_lib_1.2.1.tar.gz) but I'm getting this error I don't
understand:

"Unmarshalling Error: Unable to create an instance of
com.google.ads.api.services.campaignmgmt.campaign.v200906.jaxbgen.BiddingStrategy"

Enabling SOAP debug, this is the outgoing request:

<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
><SOAP-ENV:Header><RequestHeader xmlns="https://adwords.google.com/api/
adwords/cm/v200906"><applicationToken>MyAppToken</
applicationToken><authToken>REDACTED</authToken><clientEmail>MyEmail</
clientEmail><developerToken>MyDevToken</developerToken><userAgent>Perl
Google::AdWords::Client v1.2.1: Xyz</userAgent></RequestHeader></SOAP-
ENV:Header><SOAP-ENV:Body><mutate xmlns="https://adwords.google.com/
api/adwords/cm/v200906"><operations><operator>ADD</
operator><operand><name> 1248823406</name><status>ACTIVE</
status><budget><period>DAILY</period><amount><microAmount>10000</
microAmount></amount><deliveryMethod>STANDARD</deliveryMethod></
budget><biddingStrategy><BiddingStrategy.Type>ManualCPC</
BiddingStrategy.Type></biddingStrategy></operand></operations></
mutate></SOAP-ENV:Body></SOAP-ENV:Envelope>

this is the incoming response:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/
envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</
faultcode><faultstring>Unmarshalling Error: Unable to create an
instance of
com.google.ads.api.services.campaignmgmt.campaign.v200906.jaxbgen.BiddingStrategy
</faultstring></soap:Fault></soap:Body></soap:Envelope>

I tried to create a Campaign without a bidding strategy (hoping it
would default to one) and it gives me the following, which I'm
assuming means it wants a biddingStragegy

[RequiredError.REQUIRED @ operations[0].operand.biddingStrategy]

I get this in and out of the sandbox.

Any help would be gratefully received.

AdWords API Advisor

unread,
Jul 29, 2009, 10:05:32 AM7/29/09
to AdWords API Forum
Hi there,

It looks like you have something unexpected in your XML:

<biddingStrategy>
<BiddingStrategy.Type>ManualCPC</BiddingStrategy.Type>
</biddingStrategy>

Here's what the API is expecting:

<biddingStrategy xsi:type="ManualCPC" />

that is, an element called "biddingStrategy", with "ManualCPC" as its
xsi:type.

Since you didn't post your perl code, it's hard to tell what could be
wrong there. Perhaps the example at
http://code.google.com/p/google-api-adwords-perl/source/browse/trunk/example/add_all.pl
would help?

Cheers,
Sérgio Gomes, AdWords API Team

---

Exiges

unread,
Jul 29, 2009, 9:53:33 AM7/29/09
to AdWords API Forum
I found the solution, and in case anyone else has the same problem..

<biddingStrategy><BiddingStrategy.Type>ManualCPC</
BiddingStrategy.Type></biddingStrategy>

Should have been:

<biddingStrategy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="ManualCPC"><BiddingStrategy.Type>ManualCPC</
BiddingStrategy.Type></biddingStrategy>

In Perl, my associative array was like this

biddingStrategy => { BiddingStrategy__Type => "ManualCPC" }

When it should have been like

biddingStrategy => Google::AdWords::v200906::Types::ManualCPC->new()

AdWords API Advisor

unread,
Jul 30, 2009, 7:13:20 AM7/30/09
to AdWords API Forum
Glad to hear it worked! Thanks for posting the solution to the group.

Cheers,
Sergio Gomes, AdWords API Team

---
Reply all
Reply to author
Forward
0 new messages