Hi Anash P. Oommen,

Thank you for your help!
Another question would be!
Do you think it will be good?

$xml_data = '
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
........................
........................
</soap:Envelope>
';

$feedUrl = "https://adwords-sandbox.google.com/api/adwords/o/v201109/
TargetingIdeaService?wsdl";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $feedUrl);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/
soap+xml; charset=utf-8"));
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data);
$data = curl_exec($ch);

Again, thank you!


On jan. 9, 10:21, "Anash P. Oommen" <[email protected]>
wrote:
> Hi Máté,
>
> The error message says
>
> Unmarshalling Error: Unable to create an instance of
> com.google.ads.api.services.targetingideas.v201101.jaxbgen.SearchParameter
>
> I think your code is not generating proper SOAP xml. My guess on the
> specifics would be that your code is not adding an xsi:type on
> related_to_keyword_search_parameter, and so AdWords server is trying to
> deserialize the object as a SearchParameter instead of 
> RelatedToKeywordSearchParameter.
> This would fail of course, since SearchParameter class is abstract. 
> Seehttp://code.google.com/apis/adwords/docs/reference/latest/TargetingId...for
> details.
>
> I would recommend that you use the PHP client library 
> athttp://code.google.com/p/google-api-adwords-php/, but in case you can't,
> here's a reference xml for debugging your request:
>
> <?xml version="1.0" encoding="utf-8"?>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
> <soap:Header>
> <RequestHeader xmlns="https://adwords.google.com/api/adwords/o/v201109";>
> <authToken
> xmlns="https://adwords.google.com/api/adwords/cm/v201109";>******</authToken>
> <developerToken
> xmlns="https://adwords.google.com/api/adwords/cm/v201109";>******</developerToken>
> <clientCustomerId
> xmlns="https://adwords.google.com/api/adwords/cm/v201109";>918-501-8835</clientCustomerId>
> <userAgent
> xmlns="https://adwords.google.com/api/adwords/cm/v201109";>AwApi-DotNet-0.0.0|INSERT_YOUR_COMPANY_OR_APPLICATION_NAME_HERE</userAgen
>  t>
> </RequestHeader>
> </soap:Header>
> <soap:Body>
> <get xmlns="https://adwords.google.com/api/adwords/o/v201109";>
> <selector>
> <searchParameters xsi:type="RelatedToKeywordSearchParameter">
> <keywords>
> <text xmlns="https://adwords.google.com/api/adwords/cm/v201109";>mars
> cruise</text>
> <matchType
> xmlns="https://adwords.google.com/api/adwords/cm/v201109";>BROAD</matchType>
> </keywords>
> </searchParameters>
> <searchParameters xsi:type="KeywordMatchTypeSearchParameter">
> <keywordMatchTypes>BROAD</keywordMatchTypes>
> </searchParameters>
> <ideaType>KEYWORD</ideaType>
> <requestType>IDEAS</requestType>
> <requestedAttributeTypes>CRITERION</requestedAttributeTypes>
> <requestedAttributeTypes>AVERAGE_TARGETED_MONTHLY_SEARCHES</requestedAttrib 
> uteTypes>
> <paging>
> <startIndex
> xmlns="https://adwords.google.com/api/adwords/cm/v201109";>0</startIndex>
> <numberResults
> xmlns="https://adwords.google.com/api/adwords/cm/v201109";>100</numberResults>
> </paging>
> </selector>
> </get>
> </soap:Body>
> </soap:Envelope>
>
> Btw, what Evgeniy mentioned is also correct, though you will hit it
> immediately after you solve this issue - if you notice on the xml,
> RequestHeader is on o/ namespace, its children are on cm/ namespace.
>
> Cheers,
> Anash P. Oommen,
> AdWords API Advisor.

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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

Reply via email to