gpt4 book ai didi

java - 使用 JAVA AdWords API 更新现有 Feed 记录

转载 作者:行者123 更新时间:2023-12-01 23:52:46 25 4
gpt4 key购买 nike

我想使用 JAVA AdWords API 更新现有的 Feed 记录。

我尝试过,但收到此错误 FeedError.DUPLICATE_FEED_NAME我想在 SAME Feed 中进行更改。

这可能吗?

代码链接: https://www.dropbox.com/home/my%20folder?preview=AddSiteLinksUsingFeeds.java

错误:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/C:/Users/Shoaib/.m2/repository/com/google/inject/guice/4.2.2/guice-4.2.2.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[03 Oct 2019 03:17:59,332-requestInfoLogger:WARN:main] Request made: Service: FeedService Method: mutate clientCustomerId: 209-376-1609 URL: https://adwords.google.com/api/adwords/cm/v201809/FeedService Request ID: 000593fee235f2a202ab42d7be091ca3 ResponseTime(ms): 147 OperationsCount: 0 IsFault: true FaultMessage: ApiException{applicationExceptionType=ApiException, errors=[FeedError{apiErrorType=FeedError, errorString=FeedError.DUPLICATE_FEED_NAME, fieldPath=operations[0].operand.name, fieldPathElements=[FieldPathElement{field=operations, index=0}, FieldPathElement{field=operand}, FieldPathElement{field=name}], reason=DUPLICATE_FEED_NAME, trigger=Feed test 7.6}]}
[03 Oct 2019 03:17:59,371-soapXmlLogger:INFO:main] SOAP request:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Header>

<ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809" soapenv:mustUnderstand="0">

<ns1:clientCustomerId>209-376-1609</ns1:clientCustomerId>

<ns1:developerToken>REDACTED</ns1:developerToken>

<ns1:userAgent>unknown (AwApi-Java, AdWords-Axis/4.7.0, Common-Java/4.7.0, Axis/1.4, Java/12, maven)</ns1:userAgent>

<ns1:validateOnly>false</ns1:validateOnly>

<ns1:partialFailure>false</ns1:partialFailure>

</ns1:RequestHeader>

</soapenv:Header>

<soapenv:Body>

<mutate xmlns="https://adwords.google.com/api/adwords/cm/v201809">

<operations>

<operator>ADD</operator>

<operand>

<name>Feed test 7.6</name>

<attributes>

<name>Listing ID</name>

<type>STRING</type>

</attributes>

<attributes>

<name>Listing Name</name>

<type>STRING</type>

</attributes>

<attributes>

<name>Final URL</name>

<type>URL_LIST</type>

</attributes>

<attributes>

<name>Image URL</name>

<type>URL</type>

</attributes>

<attributes>

<name>City name</name>

<type>STRING</type>

</attributes>

<attributes>

<name>Description</name>

<type>STRING</type>

</attributes>

<attributes>

<name>Price</name>

<type>STRING</type>

</attributes>

<attributes>

<name>Property type</name>

<type>STRING</type>

</attributes>

<attributes>

<name>Listing type</name>

<type>STRING</type>

</attributes>

<attributes>

<name>Contextual keywords</name>

<type>STRING_LIST</type>

</attributes>

<attributes>

<name>Address</name>

<type>STRING</type>

</attributes>

<origin>USER</origin>

</operand>

</operations>

</mutate>

</soapenv:Body>

</soapenv:Envelope>

[03 Oct 2019 03:17:59,371-soapXmlLogger:INFO:main] SOAP response:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201809">
<requestId>000593fee235f2a202ab42d7be091ca3</requestId>
<serviceName>FeedService</serviceName>
<methodName>mutate</methodName>
<operations>0</operations>
<responseTime>147</responseTime>
</ResponseHeader>
</soap:Header>
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>[FeedError.DUPLICATE_FEED_NAME @ operations[0].operand.name; trigger:'Feed test 7.6']</faultstring>
<detail>
<ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201809">
<message>[FeedError.DUPLICATE_FEED_NAME @ operations[0].operand.name; trigger:'Feed test 7.6']</message>
<ApplicationException.Type>ApiException</ApplicationException.Type>
<errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="FeedError">
<fieldPath>operations[0].operand.name</fieldPath>
<fieldPathElements>
<field>operations</field>
<index>0</index>
</fieldPathElements>
<fieldPathElements>
<field>operand</field>
</fieldPathElements>
<fieldPathElements>
<field>name</field>
</fieldPathElements>
<trigger>Feed test 7.6</trigger>
<errorString>FeedError.DUPLICATE_FEED_NAME</errorString>
<ApiError.Type>FeedError</ApiError.Type>
<reason>DUPLICATE_FEED_NAME</reason>
</errors>
</ApiExceptionFault>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>

Request failed due to ApiException. Underlying ApiErrors:
Error 0: FeedError{apiErrorType=FeedError, errorString=FeedError.DUPLICATE_FEED_NAME, fieldPath=operations[0].operand.name, fieldPathElements=[FieldPathElement{field=operations, index=0}, FieldPathElement{field=operand}, FieldPathElement{field=name}], reason=DUPLICATE_FEED_NAME, trigger=Feed test 7.6}

最佳答案

如果您想要修改现有 Feed,则需要使用 SET 运算符而不是 ADD 并提供 feed ID饲料。

关于java - 使用 JAVA AdWords API 更新现有 Feed 记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58214927/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com