Duplicate Element

892 views
Skip to first unread message

Syed

unread,
Sep 24, 2010, 9:44:31 AM9/24/10
to AdWords API Forum
Hi,

I was trying to add Campaign. When i do that am getting this
following error. I used the same code some times back(one or two weeks
back), it works fine. I have made no changes to the code.

But still am getting this error.

This exception occurs when i try to save the changes made to existing
campaign.

[DistinctError.DUPLICATE_ELEMENT @ operations[3].operand.targets[2]]

Can you please tell me what does this error exactly means.

Urgent please

Thanks

/javeed

AdWords API Advisor

unread,
Sep 24, 2010, 11:53:14 AM9/24/10
to AdWords API Forum
Hi Javeed,

Can you please post the requestId so I may check it?

Cheers,
Anash P. Oommen,
AdWords API Advisor.

Syed Javeed

unread,
Sep 26, 2010, 10:27:08 AM9/26/10
to adwordsa...@google.com, AdWords API Forum
There is the soap log msg. Please reply me soon. as its urgent. Is there anything am doing wrong.


<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v200909"><requestId>fbe52866b9d0f9660841756d38a88ba1</requestId><operations>1</operations><responseTime>525</responseTime><units>1</units></ResponseHeader></soap:Header><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>[DistinctError.DUPLICATE_ELEMENT @ operations[3].operand.targets[1]]</faultstring><detail><ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v200909"><message>[DistinctError.DUPLICATE_ELEMENT @ operations[3].operand.targets[1]]</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors xsi:type="DistinctError" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><fieldPath>operations[3].operand.targets[1]</fieldPath><trigger/><ApiError.Type>DistinctError</ApiError.Type><reason>DUPLICATE_ELEMENT</reason></errors></ApiExceptionFault></detail></soap:Fault></soap:Body></soap:Envelope>


thanking you,
/javeed



--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

AdWords API Advisor

unread,
Sep 27, 2010, 8:34:57 AM9/27/10
to AdWords API Forum
Hi Javeed,

I looked up your request xml from the requestId. Looks like the error
is exactly what is says in the fault string, i.e.
DistinctError.DUPLICATE_ELEMENT
@ operations[3].operand.targets[1]]. The sanitized xml for your
request's 4th operation is pasted below:

<operations>
<operator>SET</operator>
<operand xsi:type="ns5:NetworkTargetList" xmlns:ns5="https://
adwords.google.com/api/adwords/cm/v200909">
<campaignId>XXXXXX</campaignId>
<targets>
<networkCoverageType>SEARCH_NETWORK</networkCoverageType>
</targets>
<targets>
<networkCoverageType>SEARCH_NETWORK</networkCoverageType>
</targets>
<targets>
<networkCoverageType>CONTENT_NETWORK</networkCoverageType>
</targets>
<targets>
<networkCoverageType>GOOGLE_SEARCH</networkCoverageType>
</targets>
</operand>
</operations>

As you can see, SEARCH_NETWORK target is repeated twice, which causes
the server to raise a DistinctError on the second target.

Hope this helps. Let me know if you have more questions.

Cheers,
Anash P. Oommen,
AdWords API Advisor.



On Sep 26, 7:27 pm, Syed Javeed <javeed.s...@gmail.com> wrote:
> There is the soap log msg. Please reply me soon. as its urgent. Is there
> anything am doing wrong.
>
> <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ResponseHeader
> xmlns="https://adwords.google.com/api/adwords/cm/v200909"><requestId>fbe52866b9d0f9660841756d38a88ba1</requestId><operations>1</ope rations><responseTime>525</responseTime><units>1</units></ResponseHeader></ soap:Header><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><fault string>[DistinctError.DUPLICATE_ELEMENT
> @ operations[3].operand.targets[1]]</faultstring><detail><ApiExceptionFault
> xmlns="https://adwords.google.com/api/adwords/cm/v200909"><message>[DistinctError.DUPLICATE_ELEMENT
> @
> operations[3].operand.targets[1]]</message><ApplicationException.Type>ApiEx ception</ApplicationException.Type><errors
> xsi:type="DistinctError" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
> "><fieldPath>operations[3].operand.targets[1]</fieldPath><trigger/><ApiErro r.Type>DistinctError</ApiError.Type><reason>DUPLICATE_ELEMENT</reason></err ors></ApiExceptionFault></detail></soap:Fault></soap:Body></soap:Envelope>
> > adwords-api...@googlegroups.com<adwords-api%2Bunsubscribe@googlegr oups.com>
Reply all
Reply to author
Forward
0 new messages