Martialdelastic / google-api-adwords-php

Automatically exported from code.google.com/p/google-api-adwords-php
Apache License 2.0
0 stars 0 forks source link

Unmarshalling Error: Unable to create an instance #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
version of the library - aw_api_php_lib_2.2.0
version of PHP - 5.2.13 

What steps will reproduce the problem? (sample code: GetRelatedKeywords.php)
What do you see instead? 
SoapFault Object ( [message:protected] => Unmarshalling Error: Unable to create 
an instance of 
com.google.ads.api.services.targetingideas.v201003.jaxbgen.SearchParameter 
[string:private] => [code:protected] => 0 [file:protected] =(..)

Whole bug report in atteched file.

Original issue reported on code.google.com by naviga...@navigator-bc.pl on 9 Jul 2010 at 12:02

Attachments:

GoogleCodeExporter commented 8 years ago
I'm not able to replicate this in my environment on the same version of PHP.  
Can you attach the output of calling php -i in your environment?  You may want 
to scan through the output to make sure it doesn't include any sensitive 
information.

Original comment by api.ekol...@gmail.com on 9 Jul 2010 at 7:38

GoogleCodeExporter commented 8 years ago
I'm not sure what you mean, so if attached file is not what you need, please 
instruct me what exactly I should give you.

Original comment by naviga...@navigator-bc.pl on 15 Jul 2010 at 10:03

Attachments:

GoogleCodeExporter commented 8 years ago
The problem with your request is that the xsi:type attribute is not being set 
correctly on the searchParameters element:

<ns2:searchParameters>
  <ns2:keywords>
    <ns1:text>mars cruise</ns1:text>
    <ns1:matchType>BROAD</ns1:matchType>
  </ns2:keywords>
</ns2:searchParameters>

This should be done automatically by the SoapClient library, but isn't in your 
case.  When I run GetRelatedKeywords.php in PHP 5.2.13 my xsi:types are set 
correctly.

The information I am asking for is a print out of the PHP environment 
configuration.  You can get it by running "php -i" from the command line:

$ php -i
phpinfo()
PHP Version => 5.3.2
...

Please make sure you remove any sensitive information from the output.

Original comment by api.ekol...@gmail.com on 15 Jul 2010 at 7:13

GoogleCodeExporter commented 8 years ago
Ok, it's done, I hope it will help.

Original comment by naviga...@navigator-bc.pl on 16 Jul 2010 at 7:08

Attachments:

GoogleCodeExporter commented 8 years ago
I don't see anything wrong or even that different in your configuration, so I'm 
not sure why it isn't working in your environment.  Try editing line 367 of 
AdsSoapClient.

  http://code.google.com/p/google-api-adwords-php/source/browse/trunk/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php#367

Change it from:

  $addXsiTypes = version_compare(PHP_VERSION, '5.2.7', '<');

to:

  $addXsiTypes = TRUE;

Let me know if that fixes the problem.

Original comment by api.ekol...@gmail.com on 16 Jul 2010 at 3:26

GoogleCodeExporter commented 8 years ago
Thanks a lot, your tip helped, now it's correct.

Original comment by naviga...@navigator-bc.pl on 16 Jul 2010 at 8:10

GoogleCodeExporter commented 8 years ago

Original comment by ekoleda+devrel@googlers.com on 9 Sep 2011 at 2:45