when I use Operator.SET

<?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>538-310-7482</ns1:clientCustomerId>
            <ns1:developerToken>REDACTED</ns1:developerToken>
            <ns1:userAgent>HUYA PTE.LTD (AwApi-Java, AdWords-Axis/4.9.1, 
Common-Java/4.9.1, Axis/1.4, Java/1.8.0_251, 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>SET</operator>
                <operand>
                    <adGroupId>106842473651</adGroupId>
                    <ad 
xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201809"; 
xsi:type="ns2:UniversalAppAd">
                        <ns2:id>435120021537</ns2:id>
                        <ns2:headlines>
                            <ns2:asset xsi:type="ns2:TextAsset">
                                <ns2:assetText>new Title 1</ns2:assetText>
                            </ns2:asset>
                        </ns2:headlines>
                        <ns2:headlines>
                            <ns2:asset xsi:type="ns2:TextAsset">
                                <ns2:assetText>new Title 2</ns2:assetText>
                            </ns2:asset>
                        </ns2:headlines>
                        <ns2:descriptions>
                            <ns2:asset xsi:type="ns2:TextAsset">
                                <ns2:assetText>new desc</ns2:assetText>
                            </ns2:asset>
                        </ns2:descriptions>
                    </ad>
                    <status>ENABLED</status>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>
</soapenv:Envelope>

2020-05-12 20:53:29.141 INFO   [thread:main,pid:PID_IS_UNDEFINED] 
com.google.api.ads.adwords.lib.client.AdWordsServiceClient.soapXmlLogger 
--- 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>0005a572f3c393cc0a62cfc47b04a8a2</requestId>
            <serviceName>AdGroupAdService</serviceName>
            <methodName>mutate</methodName>
            <operations>1</operations>
            <responseTime>251</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Client</faultcode>
            <faultstring>[AdError.CANNOT_USE_AD_SUBCLASS_FOR_OPERATOR @ 
operations[0].operand.ad]</faultstring>
            <detail>
                <ApiExceptionFault 
xmlns="https://adwords.google.com/api/adwords/cm/v201809";>
                    <message>[AdError.CANNOT_USE_AD_SUBCLASS_FOR_OPERATOR @ 
operations[0].operand.ad]</message>
                    
<ApplicationException.Type>ApiException</ApplicationException.Type>
                    <errors 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:type="AdError">
                        <fieldPath>operations[0].operand.ad</fieldPath>
                        <fieldPathElements>
                            <field>operations</field>
                            <index>0</index>
                        </fieldPathElements>
                        <fieldPathElements>
                            <field>operand</field>
                        </fieldPathElements>
                        <fieldPathElements>
                            <field>ad</field>
                        </fieldPathElements>
                        <trigger/>
                        
<errorString>AdError.CANNOT_USE_AD_SUBCLASS_FOR_OPERATOR</errorString>
                        <ApiError.Type>AdError</ApiError.Type>
                        <reason>CANNOT_USE_AD_SUBCLASS_FOR_OPERATOR</reason>
                    </errors>
                </ApiExceptionFault>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>





when I use Operator.REMOVE
<?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>538-310-7482</ns1:clientCustomerId>
            <ns1:developerToken>REDACTED</ns1:developerToken>
            <ns1:userAgent>HUYA PTE.LTD (AwApi-Java, AdWords-Axis/4.9.1, 
Common-Java/4.9.1, Axis/1.4, Java/1.8.0_251, 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>REMOVE</operator>
                <operand>
                    <adGroupId>106842473651</adGroupId>
                    <ad 
xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201809"; 
xsi:type="ns2:UniversalAppAd">
                        <ns2:id>435120021537</ns2:id>
                    </ad>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>
</soapenv:Envelope>

2020-05-12 20:55:18.248 INFO   [thread:main,pid:PID_IS_UNDEFINED] 
com.google.api.ads.adwords.lib.client.AdWordsServiceClient.soapXmlLogger 
--- 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>0005a572fa3eeab50aa79406800d6ce0</requestId>
            <serviceName>AdGroupAdService</serviceName>
            <methodName>mutate</methodName>
            <operations>1</operations>
            <responseTime>613</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Client</faultcode>
            
<faultstring>[OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE 
@ operations[0].operand.ad]</faultstring>
            <detail>
                <ApiExceptionFault 
xmlns="https://adwords.google.com/api/adwords/cm/v201809";>
                    
<message>[OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE @ 
operations[0].operand.ad]</message>
                    
<ApplicationException.Type>ApiException</ApplicationException.Type>
                    <errors 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="OperationAccessDenied">
                        <fieldPath>operations[0].operand.ad</fieldPath>
                        <fieldPathElements>
                            <field>operations</field>
                            <index>0</index>
                        </fieldPathElements>
                        <fieldPathElements>
                            <field>operand</field>
                        </fieldPathElements>
                        <fieldPathElements>
                            <field>ad</field>
                        </fieldPathElements>
                        <trigger/>
                        
<errorString>OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE</errorString>
                        <ApiError.Type>OperationAccessDenied</ApiError.Type>
                        
<reason>OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE</reason>
                    </errors>
                </ApiExceptionFault>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/3f981e68-f717-4367-a824-6e652fb46c0a%40googlegroups.com.

Reply via email to