Hello!

I'm use the NoClientLibrary : 
http://code.google.com/p/google-api-dfp-php/wiki/NoClientLibrary
I'm trying to create Creatives, but I've got a problems.

I got this error, and I can't understand where the error comes from,
thank you very much for your help :

SoapFault Object ( [message:protected] => Unmarshalling Error: Unable
to create an instance of
com.google.ads.publisher.api.service.creative.v201004.jaxbgen.

This is my source :

[...]
try {
        require_once 'Ads/Common/Util/MediaUtils.php';
        require_once 'Ads/Dfp/v201004/CreativeService.php';

        $creativeService = DFP_create_service('CreativeService',$authToken,
$applicationName);

        $advertiserId = (float) '11595395'; // ID de l'advertiser

        $imageCreatives = array();

        for ($i = 0; $i < 5; $i++) {
                $imageCreative = new ImageCreative();
                $imageCreative->name = 'Image creative #' . $i;
                $imageCreative->advertiserId = $advertiserId;
                $imageCreative->destinationUrl = 'http://google.com';
                $imageCreative->imageName = 'image.jpg';
                $imageCreative->imageByteArray = 
MediaUtils::GetBase64Data('http://
www.google.com/intl/en/adwords/select/images/samples/inline.jpg');
                $imageCreative->size = new Size(300, 250);

                $imageCreatives[] = $imageCreative;
        }

        $imageCreatives = $creativeService-
>createCreatives($imageCreatives); // Création des Creative
}
catch (Exception $e){
  print_r($e);
}


// Return a SoapClient with the Service asked
function DFP_create_service($service,$authToken,$applicationName){
        $wsdl = 'https://www.google.com/apis/ads/publisher/v201004/'.
$service.'?wsdl';
        $namespace = 'https://www.google.com/apis/ads/publisher/v201004';
        $options = array('features' => SOAP_SINGLE_ELEMENT_ARRAYS,'encoding'
=> 'utf-8');
        $service = new SoapClient($wsdl, $options);
        $headers = new SoapHeader($namespace, 'RequestHeader',
array('authToken' => $authToken->GetAuthToken(),'applicationName' =>
$applicationName));
        $service->__setSoapHeaders($headers);
        return $service;
}

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to