Hi ,
我尝试在targetingIdeaService中添加LocationSearchParameter,但是我遇到以下错误,Exception
'SoapFault' with message 'Unmarshalling Error: cvc-type.2: The type
definition cannot be abstract for element ns1:searchParameters. '
SOAP:
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="https://adwords.google.com/api/adwords/o/v201809"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201809">
<SOAP-ENV:Header>
<ns1:RequestHeader>
<ns2:clientCustomerId>917-615-4256</ns2:clientCustomerId>
<ns2:developerToken>REDACTED</ns2:developerToken>
<ns2:userAgent>unknown (AwApi-PHP, googleads-php-lib/40.0.0,
PHP/5.6.40)</ns2:userAgent>
<ns2:validateOnly>false</ns2:validateOnly>
<ns2:partialFailure>false</ns2:partialFailure>
</ns1:RequestHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:get>
<ns1:selector>
<ns1:searchParameters xsi:type="ns1:RelatedToQuerySearchParameter">
<ns1:queries>Call of Duty</ns1:queries>
<ns1:queries>Mobile</ns1:queries>
</ns1:searchParameters>
<ns1:searchParameters xsi:type="ns1:LanguageSearchParameter">
<ns1:languages>
<ns2:id>1000</ns2:id>
</ns1:languages>
</ns1:searchParameters>
<ns1:searchParameters/>
<ns1:searchParameters xsi:type="ns1:NetworkSearchParameter">
<ns1:networkSetting>
<ns2:targetGoogleSearch>true</ns2:targetGoogleSearch>
<ns2:targetSearchNetwork>false</ns2:targetSearchNetwork>
<ns2:targetContentNetwork>false</ns2:targetContentNetwork>
<ns2:targetPartnerSearchNetwork>false</ns2:targetPartnerSearchNetwork>
</ns1:networkSetting>
</ns1:searchParameters>
<ns1:ideaType>KEYWORD</ns1:ideaType>
<ns1:requestType>STATS</ns1:requestType>
<ns1:requestedAttributeTypes>KEYWORD_TEXT</ns1:requestedAttributeTypes>
<ns1:requestedAttributeTypes>SEARCH_VOLUME</ns1:requestedAttributeTypes>
<ns1:requestedAttributeTypes>AVERAGE_CPC</ns1:requestedAttributeTypes>
<ns1:requestedAttributeTypes>COMPETITION</ns1:requestedAttributeTypes>
<ns1:requestedAttributeTypes>CATEGORY_PRODUCTS_AND_SERVICES</ns1:requestedAttributeTypes>
<ns1:requestedAttributeTypes>EXTRACTED_FROM_WEBPAGE</ns1:requestedAttributeTypes>
<ns1:requestedAttributeTypes>TARGETED_MONTHLY_SEARCHES</ns1:requestedAttributeTypes>
<ns1:paging>
<ns2:startIndex>0</ns2:startIndex>
<ns2:numberResults>500</ns2:numberResults>
</ns1:paging>
</ns1:selector>
</ns1:get>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
here is the code
$selector->setRequestType(RequestType::STATS);
$selector->setIdeaType(IdeaType::KEYWORD);
$selector->setRequestedAttributeTypes(
[
AttributeType::KEYWORD_TEXT,
AttributeType::SEARCH_VOLUME,
AttributeType::AVERAGE_CPC,
AttributeType::COMPETITION,
AttributeType::CATEGORY_PRODUCTS_AND_SERVICES,
AttributeType::EXTRACTED_FROM_WEBPAGE,
AttributeType::TARGETED_MONTHLY_SEARCHES
]
);
$relatedToQuerySearchParameter = new RelatedToQuerySearchParameter();
if (is_array($keyword)) {
$relatedToQuerySearchParameter->setQueries($keyword);
} else {
$relatedToQuerySearchParameter->setQueries([$keyword]);
}
$searchParameters[] = $relatedToQuerySearchParameter;
$locationParameter = new
\Google\AdsApi\AdWords\v201806\o\LocationSearchParameter();
$location = new \Google\AdsApi\AdWords\v201809\cm\Location();
$location->setId(2643);
$locationParameter->setLocations([$location]);
$searchParameters[] = $locationParameter;
thank you
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/76225ae7-71d8-4c7e-8b90-4b48c5157813n%40googlegroups.com.