Error java- operations[4].operand.biddingStrategyConfiguration

146 views
Skip to first unread message

No body pratap singh

unread,
Jun 23, 2016, 3:15:46 AM6/23/16
to AdWords API Forum
I am trying to add 3 product type as custom attribute and making last custion label as biddable .
While making product partition tree i am getting the following soap error .
Also find the soap request header.



RESPONSE ERROR

<?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/v201601">
            <requestId>000535ec007ccc300a624e8743037434</requestId>
            <serviceName>AdGroupCriterionService</serviceName>
            <methodName>mutate</methodName>
            <operations>8</operations>
            <responseTime>296</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>[RequiredError.REQUIRED @ operations[4].operand.biddingStrategyConfiguration]</faultstring>
            <detail>
                <ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201601">
                    <message>[RequiredError.REQUIRED @ operations[4].operand.biddingStrategyConfiguration]</message>
                    <ApplicationException.Type>ApiException</ApplicationException.Type>
                    <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RequiredError">
                        <fieldPath>operations[4].operand.biddingStrategyConfiguration</fieldPath>
                        <trigger/>
                        <errorString>RequiredError.REQUIRED</errorString>
                        <ApiError.Type>RequiredError</ApiError.Type>
                        <reason>REQUIRED</reason>
                    </errors>
                </ApiExceptionFault>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

SOAP REQUEST 

    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201601" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>11111</ns1:clientCustomerId>
            <ns1:developerToken>REDACTED</ns1:developerToken>
            <ns1:userAgent>csdc (AwApi-Java, AdWords-Axis/2.15.0, Common-Java/2.15.0, Axis/1.4, Java/1.7.0_80, maven, ProductPartitionTree, SelectorBuilder)</ns1:userAgent>
            <ns1:validateOnly>false</ns1:validateOnly>
            <ns1:partialFailure>false</ns1:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
            <operations>
                <operator>REMOVE</operator>
                <operand>
                    <adGroupId>29789572975</adGroupId>
                    <criterion xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns2:ProductPartition">
                        <id>18283950120</id>
                    </criterion>
                </operand>
            </operations>
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns3="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns3:BiddableAdGroupCriterion">
                    <adGroupId>29789572975</adGroupId>
                    <criterion xsi:type="ns3:ProductPartition">
                        <id>-1</id>
                        <partitionType>SUBDIVISION</partitionType>
                    </criterion>
                </operand>
            </operations>
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns4="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns4:BiddableAdGroupCriterion">
                    <adGroupId>29789572975</adGroupId>
                    <criterion xsi:type="ns4:ProductPartition">
                        <id>-2</id>
                        <partitionType>SUBDIVISION</partitionType>
                        <parentCriterionId>-1</parentCriterionId>
                        <caseValue xsi:type="ns4:ProductCustomAttribute">
                            <type>CUSTOM_ATTRIBUTE_1</type>
                            <value>gm120</value>
                        </caseValue>
                    </criterion>
                </operand>
            </operations>
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns5="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns5:BiddableAdGroupCriterion">
                    <adGroupId>29789572975</adGroupId>
                    <criterion xsi:type="ns5:ProductPartition">
                        <id>-3</id>
                        <partitionType>SUBDIVISION</partitionType>
                        <parentCriterionId>-2</parentCriterionId>
                        <caseValue xsi:type="ns5:ProductCustomAttribute">
                            <type>CUSTOM_ATTRIBUTE_2</type>
                            <value>Electronics</value>
                        </caseValue>
                    </criterion>
                </operand>
            </operations>
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns6="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns6:BiddableAdGroupCriterion">
                    <adGroupId>29789572975</adGroupId>
                    <criterion xsi:type="ns6:ProductPartition">
                        <id>-4</id>
                        <partitionType>UNIT</partitionType>
                        <parentCriterionId>-3</parentCriterionId>
                        <caseValue xsi:type="ns6:ProductCustomAttribute">
                            <type>CUSTOM_ATTRIBUTE_3</type>
                            <value>Electronics</value>
                        </caseValue>
                    </criterion>
                </operand>
            </operations>
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns7="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns7:NegativeAdGroupCriterion">
                    <adGroupId>29789572975</adGroupId>
                    <criterion xsi:type="ns7:ProductPartition">
                        <id>-5</id>
                        <partitionType>UNIT</partitionType>
                        <parentCriterionId>-3</parentCriterionId>
                        <caseValue xsi:type="ns7:ProductCustomAttribute">
                            <type>CUSTOM_ATTRIBUTE_3</type>
                        </caseValue>
                    </criterion>
                </operand>
            </operations>
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns8="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns8:NegativeAdGroupCriterion">
                    <adGroupId>29789572975</adGroupId>
                    <criterion xsi:type="ns8:ProductPartition">
                        <id>-6</id>
                        <partitionType>UNIT</partitionType>
                        <parentCriterionId>-2</parentCriterionId>
                        <caseValue xsi:type="ns8:ProductCustomAttribute">
                            <type>CUSTOM_ATTRIBUTE_2</type>
                        </caseValue>
                    </criterion>
                </operand>
            </operations>
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns9="https://adwords.google.com/api/adwords/cm/v201601" xsi:type="ns9:NegativeAdGroupCriterion">
                    <adGroupId>29789572975</adGroupId>
                    <criterion xsi:type="ns9:ProductPartition">
                        <id>-7</id>
                        <partitionType>UNIT</partitionType>
                        <parentCriterionId>-1</parentCriterionId>
                        <caseValue xsi:type="ns9:ProductCustomAttribute">
                            <type>CUSTOM_ATTRIBUTE_1</type>
                        </caseValue>
                    </criterion>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>
</soapenv:Envelope>




Joyce Lava

unread,
Jun 23, 2016, 4:34:59 AM6/23/16
to AdWords API Forum
Hi,

Please refer to this forum discussion. Please check also the documentation for more information (Java client library). 

Hope it helps.

Thanks,
Joyce, AdWords API Team

jhufg.567484

unread,
Jun 23, 2016, 5:34:24 AM6/23/16
to AdWords API Forum
Hi joyce,

It doesn't solve my problem .
please find the java code below for clear visualization what i am  trying to do.

ProductPartitionTree partitionTree = ProductPartitionTree.createAdGroupTree(adWordsServices, adWordsSession,
adGroupId);
Long partitionId = null;
ProductPartitionNode rootNode = partitionTree.getRoot().asSubdivision();
ProductCustomAttribute productCustomAttribute1 = ProductDimensions.createCustomAttribute(ProductDimensionType.CUSTOM_ATTRIBUTE_1, customLabelValues.getCustomLabel1());
if(!rootNode.hasChild(productCustomAttribute1)){
rootNode.addChild(productCustomAttribute1).asSubdivision();
}
ProductCustomAttribute excludedProductCustomAttribute1 = ProductDimensions.createCustomAttribute(ProductDimensionType.CUSTOM_ATTRIBUTE_1, null);
if(!rootNode.hasChild(excludedProductCustomAttribute1)){
rootNode.addChild(excludedProductCustomAttribute1).asExcludedUnit();
}
rootNode = rootNode.getChild(productCustomAttribute1);
ProductCustomAttribute productCustomAttribute2 = ProductDimensions.createCustomAttribute(ProductDimensionType.CUSTOM_ATTRIBUTE_2, customLabelValues.getCustomLabel2());
if(!rootNode.hasChild(productCustomAttribute2)){
rootNode.addChild(productCustomAttribute2).asSubdivision();
}
ProductCustomAttribute excludedProductCustomAttribute2 = ProductDimensions.createCustomAttribute(ProductDimensionType.CUSTOM_ATTRIBUTE_2, null);
if(!rootNode.hasChild(excludedProductCustomAttribute2)){
rootNode.addChild(excludedProductCustomAttribute2).asExcludedUnit();
}
rootNode = rootNode.getChild(productCustomAttribute2);
ProductCustomAttribute productCustomAttribute3 = ProductDimensions.createCustomAttribute(ProductDimensionType.CUSTOM_ATTRIBUTE_3, customLabelValues.getCustomLabel3());
if(!rootNode.hasChild(productCustomAttribute3)){
rootNode.addChild(productCustomAttribute3).asBiddableUnit().setBid(bidAmount);
}else if(!rootNode.getChild(productCustomAttribute3).getBid().equals(bidAmount)){
rootNode.getChild(productCustomAttribute3).setBid(bidAmount);
partitionId = rootNode.getChild(productCustomAttribute3).getProductPartitionId();
}
ProductCustomAttribute excludedProductCustomAttribute3 = ProductDimensions.createCustomAttribute(ProductDimensionType.CUSTOM_ATTRIBUTE_3, null);
if(!rootNode.hasChild(excludedProductCustomAttribute3)){
rootNode.addChild(excludedProductCustomAttribute3).asExcludedUnit();
}
AdGroupCriterionServiceInterface adGroupCriterionService = adWordsServices.get(adWordsSession,
AdGroupCriterionServiceInterface.class);

java.util.List<AdGroupCriterionOperation> mutateOperations = partitionTree.getMutateOperations();
if (mutateOperations.isEmpty()) {
//Skipping the mutate call because the original tree and the current tree are logically identical
return rootNode.getChild(productCustomAttribute3).getProductPartitionId();
} else {
adGroupCriterionService.mutate(mutateOperations.toArray(new AdGroupCriterionOperation[0]));
if(partitionId!=null)
return partitionId;
partitionTree = ProductPartitionTree.createAdGroupTree(adWordsServices, adWordsSession,
adGroupId);
rootNode = partitionTree.getRoot().asSubdivision();
return rootNode.getChild(productCustomAttribute1).getChild(productCustomAttribute2).getChild(productCustomAttribute3).getProductPartitionId();
}

jhufg.567484

unread,
Jun 23, 2016, 6:12:31 AM6/23/16
to AdWords API Forum
Hi Joyce,

Did you get my problem.Any updates regarding same.

jhufg.567484

unread,
Jun 23, 2016, 7:39:23 AM6/23/16
to AdWords API Forum
Hi Joyce,

     It has been resolved from my end itself. I was suplying null budget Amount value by mistake. I changed it to a finite values and it did work.

     Thanks for you concern.

Regards,
Tejendra

On Thursday, June 23, 2016 at 12:45:46 PM UTC+5:30, jhufg.567484 wrote:
Reply all
Reply to author
Forward
0 new messages