AdGroupCriterionService: cvc-complex-type.2.4.d: Invalid content was found starting 'v20:matchType'.

149 views
Skip to first unread message

neha sahu

unread,
Sep 18, 2017, 4:52:30 AM9/18/17
to AdWords API Forum
I am using 'mutate' operation of 'AdGroupCriterionService' service in SOAP UI to create a 'KEYWORD' type criteria.
Can you please help on how can I send 'matchType' and 'text' input ?

Please find below request I am sending:
   <soapenv:Header>
      <v20:RequestHeader>
         <!--Optional:-->
         <v20:clientCustomerId>104-851-1999</v20:clientCustomerId>
         <!--Optional:-->
         <v20:developerToken>xyz</v20:developerToken>
         <!--Optional:-->
         <v20:userAgent>soft</v20:userAgent>
         <!--Optional:-->
         <v20:validateOnly>false</v20:validateOnly>
         <!--Optional:-->
         <v20:partialFailure>false</v20:partialFailure>
      </v20:RequestHeader>
   </soapenv:Header>
   <soapenv:Body>
      <v20:mutate>
         <!--Zero or more repetitions:-->
         <v20:operations>
            <!--Optional:-->
            <v20:operator>ADD</v20:operator>
            <v20:operand>
               <!--Optional:-->
               <v20:adGroupId>54643115908</v20:adGroupId>
               <!--Optional:-->
               <v20:criterionUse>BIDDABLE</v20:criterionUse>
               <!--Optional:-->
               <v20:criterion>
                  <!--Optional:-->
                  <v20:type>KEYWORD</v20:type> 
                  <v20:Criterion.Type>Keyword</v20:Criterion.Type>                 
                  <v20:matchType>BROAD</v20:matchType>  
               </v20:criterion>       
               <!--Zero or more repetitions:-->      
            </v20:operand>
            <!--Zero or more repetitions:-->           
         </v20:operations>
      </v20:mutate>
   </soapenv:Body>
</soapenv:Envelope>

Error:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Client</faultcode>
         <faultstring>Unmarshalling Error: cvc-complex-type.2.4.d: Invalid content was found starting with element 'v20:matchType'. No child element is expected at this point.</faultstring>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>

Peter Oliquino

unread,
Sep 18, 2017, 5:25:06 AM9/18/17
to AdWords API Forum
Hi,

You may refer to the sample SOAP request and response for the necessary fields/elements required to successfully create a Keyword criterion :

<?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/v201708" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>YOUR_CUSTOMER_ID</ns1:clientCustomerId>
            <ns1:developerToken>YOUR_DEVELOPER_TOKEN</ns1:developerToken>
            <ns1:userAgent>YOUR_USER_AGENT</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/v201708">
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201708" xsi:type="ns2:BiddableAdGroupCriterion">
                    <ns2:adGroupId>THE_ADGROUP_ID</ns2:adGroupId>
                    <ns2:criterion xsi:type="ns2:Keyword">
                        <ns2:text>KEYWORD_TEXT</ns2:text>
                        <ns2:matchType>BROAD</ns2:matchType>
                    </ns2:criterion>
                    <ns2:userStatus>PAUSED</ns2:userStatus>
                    <ns2:biddingStrategyConfiguration>
                        <ns2:bids xsi:type="ns2:CpcBid">
                            <ns2:bid>
                                <ns2:microAmount>10000000</ns2:microAmount>
                            </ns2:bid>
                        </ns2:bids>
                    </ns2:biddingStrategyConfiguration>
                    <ns2:finalUrls>
                        <ns2:urls>http://example.com/mars/cruise/?kw=mars+cruise</ns2:urls>
                    </ns2:finalUrls>
                </operand>
            </operations>
            <operations>
                <operator>ADD</operator>
                <operand xmlns:ns3="https://adwords.google.com/api/adwords/cm/v201708" xsi:type="ns3:NegativeAdGroupCriterion">
                    <ns3:adGroupId>THE_ADGROUP_ID</ns3:adGroupId>
                    <ns3:criterion xsi:type="ns3:Keyword">
                        <ns3:text>ANOTHER_KEYWORD_TEXT</ns3:text>
                        <ns3:matchType>EXACT</ns3:matchType>
                    </ns3:criterion>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>
</soapenv:Envelope>
[18 Sep 2017 16:58:00,460-soapXmlLogger:DEBUG: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/v201708">
            <requestId>THE_REQUEST_ID</requestId>
            <serviceName>AdGroupCriterionService</serviceName>
            <methodName>mutate</methodName>
            <operations>2</operations>
            <responseTime>426</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <mutateResponse xmlns="https://adwords.google.com/api/adwords/cm/v201708">
            <rval>
                <ListReturnValue.Type>AdGroupCriterionReturnValue</ListReturnValue.Type>
                <value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BiddableAdGroupCriterion">
                    <adGroupId>THE_ADGROUP_ID</adGroupId>
                    <criterion xsi:type="Keyword">
                        <id>THE_KEYWORD_ID_1</id>
                        <type>KEYWORD</type>
                        <Criterion.Type>Keyword</Criterion.Type>
                        <text>KEYWORD_TEXT</text>
                        <matchType>BROAD</matchType>
                    </criterion>
                    <AdGroupCriterion.Type>BiddableAdGroupCriterion</AdGroupCriterion.Type>
                    <userStatus>PAUSED</userStatus>
                    <systemServingStatus>ELIGIBLE</systemServingStatus>
                    <approvalStatus>PENDING_REVIEW</approvalStatus>
                    <biddingStrategyConfiguration>
                        <biddingStrategyType>MANUAL_CPC</biddingStrategyType>
                        <biddingStrategySource>CAMPAIGN</biddingStrategySource>
                        <biddingScheme xsi:type="ManualCpcBiddingScheme">
                            <BiddingScheme.Type>ManualCpcBiddingScheme</BiddingScheme.Type>
                            <enhancedCpcEnabled>false</enhancedCpcEnabled>
                        </biddingScheme>
                        <bids xsi:type="CpmBid">
                            <Bids.Type>CpmBid</Bids.Type>
                            <bid>
                                <ComparableValue.Type>Money</ComparableValue.Type>
                                <microAmount>10000</microAmount>
                            </bid>
                            <cpmBidSource>ADGROUP</cpmBidSource>
                        </bids>
                        <bids xsi:type="CpcBid">
                            <Bids.Type>CpcBid</Bids.Type>
                            <bid>
                                <ComparableValue.Type>Money</ComparableValue.Type>
                                <microAmount>10000000</microAmount>
                            </bid>
                            <cpcBidSource>CRITERION</cpcBidSource>
                        </bids>
                    </biddingStrategyConfiguration>
                    <finalUrls>
                        <urls>http://example.com/mars/cruise/?kw=mars+cruise</urls>
                    </finalUrls>
                </value>
                <value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="NegativeAdGroupCriterion">
                    <adGroupId>THE_ADGROUP_ID</adGroupId>
                    <criterion xsi:type="Keyword">
                        <id>THE_KEYWORD_ID_2</id>
                        <type>KEYWORD</type>
                        <Criterion.Type>Keyword</Criterion.Type>
                        <text>ANOTHER_KEYWORD_TEXT</text>
                        <matchType>EXACT</matchType>
                    </criterion>
                    <AdGroupCriterion.Type>NegativeAdGroupCriterion</AdGroupCriterion.Type>
                </value>
            </rval>
        </mutateResponse>
    </soap:Body>
</soap:Envelope>

Let me know if this helps.

Best regards,
Peter
AdWords API Team

neha sahu

unread,
Sep 19, 2017, 3:34:52 AM9/19/17
to AdWords API Forum
Appreciate your help. It worked for me.

Just one query:
Can't we use it the same way as SOAP WSDL generates the sample request xml by just adding "text" and "matchType" fields?

Peter Oliquino

unread,
Sep 19, 2017, 4:14:44 AM9/19/17
to AdWords API Forum
Hi Neha,

My apologies as I'm not sure I follow what it is you wish to confirm regarding the SOAP and the text and matchType fields. This being said, could you provide more context regarding your concern?

Peter Oliquino

unread,
Sep 26, 2017, 4:36:33 AM9/26/17
to AdWords API Forum
Hi Neha,

Just wanted to confirm if you still require more information regarding your concern with the text and matchType fields? Feel free to write us back if you have any follow up questions.

Thanks and regards,
Peter
AdWords API Team
Reply all
Reply to author
Forward
0 new messages