Hi Konstantin,

AdWords API has xml validation turned on, and order of elements matter. It 
should be like this in your xml:

<authToken 
xmlns="https://adwords.google.com/api/adwords/cm/v201109";>****</authToken>
<developerToken 
xmlns="https://adwords.google.com/api/adwords/cm/v201109";>****</developerToken>
<clientCustomerId 
xmlns="https://adwords.google.com/api/adwords/cm/v201109";>****</clientCustomerId>
<userAgent 
xmlns="https://adwords.google.com/api/adwords/cm/v201109";>****</userAgent>

Here's a SOAP xml I captured from the .NET library for AddCampaign code 
example.

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
<soap:Header>
<RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201109";>
<authToken 
xmlns="https://adwords.google.com/api/adwords/cm/v201109";>****</authToken>
<developerToken 
xmlns="https://adwords.google.com/api/adwords/cm/v201109";>****</developerToken>
<clientCustomerId 
xmlns="https://adwords.google.com/api/adwords/cm/v201109";>****</clientCustomerId>
<userAgent 
xmlns="https://adwords.google.com/api/adwords/cm/v201109";>*****</userAgent>
</RequestHeader>
</soap:Header>
<soap:Body>
<mutate xmlns="https://adwords.google.com/api/adwords/cm/v201109";>
<operations>
<operator>ADD</operator>
<operand>
<name>Interplanetary Cruise #2012-3-29 16-53-12.725639</name>
<status>PAUSED</status>
<startDate>20120330</startDate>
<endDate>20130329</endDate>
<budget>
<period>DAILY</period>
<amount>
<microAmount>50000000</microAmount>
</amount>
<deliveryMethod>STANDARD</deliveryMethod>
</budget>
<biddingStrategy xsi:type="ManualCPC"/>
<adServingOptimizationStatus>ROTATE</adServingOptimizationStatus>
<frequencyCap>
<impressions>5</impressions>
<timeUnit>DAY</timeUnit>
<level>ADGROUP</level>
</frequencyCap>
<networkSetting>
<targetGoogleSearch>true</targetGoogleSearch>
<targetSearchNetwork>true</targetSearchNetwork>
<targetContentNetwork>false</targetContentNetwork>
<targetContentContextual>false</targetContentContextual>
<targetPartnerSearchNetwork>false</targetPartnerSearchNetwork>
</networkSetting>
</operand>
</operations>
</mutate>
</soap:Body>
</soap:Envelope>

Cheers,
Anash P. Oommen,
AdWords API Advisor.

On Thursday, 29 March 2012 16:48:08 UTC+5:30, Konstantin Khatkovskiy wrote:
>
> I am trying to access the Google AdWords API using the soap protocol and 
> curl. I get information from 
> http://code.google.com/intl/en-EN/apis/adwords/docs/
> ang get the authtoken. Then i put hello.xml 
>
> <?xml version="1.0" encoding="UTF-8"?>
>     <soap:Envelope
>       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
>       xmlns="https://adwords.google.com/api/adwords/cm/v201109";>
>       <soap:Header>
>         <RequestHeader>
>           <authToken>my_token</authToken>
>           <userAgent>hhh</userAgent>
>           <developerToken>mylo...@gmail.com++USD</developerToken>
>           <clientEmail>client_1+mylo...@gmail.com</clientEmail>
>         </RequestHeader>
>       </soap:Header>
>       <soap:Body>
>         <mutate>
>           <operations>
> <operator>ADD</operator>
>
>             <operand>
>               <name>Hello World! with cURL</name>
>               <budget>
>                 <period>DAILY</period>
>                 <amount>
>                   <microAmount>1000000000</microAmount>
>                 </amount>
>                 <deliveryMethod>STANDARD</deliveryMethod>
>               </budget>
>               <biddingStrategy
>                 xmlns:cm="https://adwords.google.com/api/adwords/cm/v201109";
>                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>                 xsi:type="cm:ManualCPC"/>
>             </operand>
>           </operations>
>         </mutate>
>       </soap:Body>
>     </soap:Envelope>
>
>
>
> then i send this file (curl --header "Content-Type: application/soap+xml" 
> --data @hello.xml  
> https://adwords-sandbox.google.com/api/adwords/cm/v201109/CampaignService-k).
> its answer:
>
> <soap:Envelope xmlns:soap="*http://schemas.xmlsoap.org/soap/envelope/*";>
>  - <#3712401.517.1333019888244.JavaMail.geo-discussion-forums@vbtf26_> <
> soap:Body>
>  - <#3712401.517.1333019888244.JavaMail.geo-discussion-forums@vbtf26_> <
> soap:Fault>
>    <faultcode>soap:Server</faultcode> 
>    <faultstring>Unmarshalling Error: unexpected element (uri:"
> https://adwords.google.com/api/adwords/cm/v201109";, local:"clientEmail"). 
> Expected elements are <{
> https://adwords.google.com/api/adwords/cm/v201109}partialFailure>,<{
> https://adwords.google.com/api/adwords/cm/v201109}userAgent>,<{
> https://adwords.google.com/api/adwords/cm/v201109}validateOnly>,<{
> https://adwords.google.com/api/adwords/cm/v201109}developerToken>,<{
> https://adwords.google.com/api/adwords/cm/v201109}clientCustomerId>,<{
> https://adwords.google.com/api/adwords/cm/v201109}authToken></faultstring> 
>   </soap:Fault>
>   </soap:Body>
>   </soap:Envelope>
>
> where did I go wrong?
> Thanks!
>
>

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to