nasrallh / 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 with Selector in v201302 (aw_api_php_lib_4.1.1) #89

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Which version of the library are you using?
v201302 (aw_api_php_lib_4.1.1)

Which version of PHP are you using?
Im using a MAMP stack on OSX Mountain Lion with PHP version 5.4.4

What steps will reproduce the problem?
aw_api_php_lib_4.1.1/examples/v201302/BasicOperations/GetCampaigns.php
aw_api_php_lib_4.1.1/examples/v201302/BasicOperations/GetKeywords.php

What is the expected output? What do you see instead?
Expected output is a list of Campaigns and Keywords
Actual Output: An error has occurred: Unmarshalling Error: cvc-elt.4.2: Cannot 
resolve 'Selector' to a type definition for element 'ns1:serviceSelector'. 

Please provide any additional information below.

Associated Adwords API Forum Post
https://groups.google.com/forum/?fromgroups=#!searchin/adwords-api/Unmarshalling
/adwords-api/j_cM2JOa9Zo/xrrVBF2cMhcJ

Issue also exists in previous version 4.1.0

Original issue reported on code.google.com by mole...@knowme.net on 19 Mar 2013 at 6:16

GoogleCodeExporter commented 8 years ago
I'm looking into this, however I can't recreate it on our environment. I'll 
contact you directly to get more information on your deployment environment.

In the mean time, do you have Suhosin installed?

Regards,

- Paul, AdWords API Team.

Original comment by api.pmat...@gmail.com on 20 Mar 2013 at 9:06

GoogleCodeExporter commented 8 years ago
Hi Paul .. We dont use Suhosin. I will email you directly with more details on 
my environment. Thanks.

Original comment by mole...@knowme.net on 20 Mar 2013 at 3:14

GoogleCodeExporter commented 8 years ago
Ho Paul .. I did some more research on this. I have a few versions of php on my 
system. One that uses Suhosin and others that do not as far as I know:

which php
/usr/bin/php

php --version
PHP 5.3.15 with Suhosin-Patch (cli) (built: Aug 28 2012 18:19:13) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

php GetCampaigns.php
An error has occurred: Unmarshalling Error: cvc-elt.4.2: Cannot resolve 
'Selector' to a type definition for element 'ns1:serviceSelector'. 

----------------

/Applications/MAMP/bin/php/php5.4.4/bin/php --version
PHP 5.4.4 (cli) (built: Jul  4 2012 17:28:56) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
    with XCache v2.0.0, Copyright (c) 2005-2012, by mOo

/Applications/MAMP/bin/php/php5.4.4/bin/php GetCampaigns.php 
An error has occurred: Unmarshalling Error: cvc-elt.4.2: Cannot resolve 
'Selector' to a type definition for element 'ns1:serviceSelector'. 

----------------

/Applications/MAMP/bin/php/php5.3.14/bin/php --version
PHP 5.3.14 (cli) (built: Jul  4 2012 17:24:17) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
    with XCache v1.3.2, Copyright (c) 2005-2011, by mOo

/Applications/MAMP/bin/php/php5.3.14/bin/php GetCampaigns.php 
An error has occurred: Unmarshalling Error: cvc-elt.4.2: Cannot resolve 
'Selector' to a type definition for element 'ns1:serviceSelector'. 

----------------

/Applications/MAMP/bin/php/php5.2.17/bin/php --version
PHP 5.2.17 (cli) (built: Jul  4 2012 17:10:25) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator

/Applications/MAMP/bin/php/php5.2.17/bin/php GetCampaigns.php 
An error has occurred: Unmarshalling Error: cvc-elt.4.2: Cannot resolve 
'Selector' to a type definition for element 'ns1:serviceSelector'. 

Original comment by mole...@knowme.net on 20 Mar 2013 at 4:29

GoogleCodeExporter commented 8 years ago
Also .. I dont think that Suhosin is installed with php5.4.4 which is what we 
use in our server environment as its not listed in the php configure properties 
(see attached php info config)

Original comment by mole...@knowme.net on 20 Mar 2013 at 4:33

Attachments:

GoogleCodeExporter commented 8 years ago
You're correct, it would be listed in the phpinfo() if it were installed.

Can you link me to the exact download you used for your php install? That way, 
perhaps I can try to recreate the exact environment and debug the issue.

Dose the issue exist in a pre-4.1.x release of the library code? I've checked 
the differences between v201209 and v201302 for the Selector wsdl definition 
and generated code and it seems to have remained the same.

Original comment by api.pmat...@gmail.com on 21 Mar 2013 at 10:48

GoogleCodeExporter commented 8 years ago
If you install the following on OSX Mountain Lion (exact version of the OS Im 
using is 10.8.3)

http://www.mamp.info/downloads/releases/MAMP_MAMP_PRO_2.1.1.zip

And execute any of the examples from the paths indicated above you should be 
able to recreate the issue.
The issue did not exist in v201209 (3.2.2)

Thanks again
Mark

Original comment by mole...@knowme.net on 21 Mar 2013 at 2:41

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I have the same issue, using
OS X 10.8.2
Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; 
root:xnu-2050.18.24~1/RELEASE_X86_64
PHP 5.3.14 (cli) (built: Jul  2 2012 08:56:54)

If I add this line to AdsSoapClient.php line 406, it works fine.
$addXsiTypes  = false;

$addXsiTypes  is normally true because on line 402, there is a check for PHP_OS 
== 'Darwin'.  I haven't dug deeper, but what is the point of addXsiTypes on OSX?

Original comment by colin.mu...@gmail.com on 27 Mar 2013 at 3:16

GoogleCodeExporter commented 8 years ago
Confirmed that this is *not* an issue on RHEL6
PHP 5.4.12 (cli) (built: Feb 20 2013 14:41:12)
Linux 2.6.32-358.el6.x86_64

I'm thinking that PHP >= 5.3 on Darwin does not need this addXsiTypes SOAP XML 
fixing.  Can you guys confirm?  

Original comment by colin.mu...@gmail.com on 27 Mar 2013 at 3:34

GoogleCodeExporter commented 8 years ago
I have exactly the same issue.

PHP 5.2.6
Windows environment

Original comment by delkos.a...@gmail.com on 27 Mar 2013 at 4:51

GoogleCodeExporter commented 8 years ago
Thanks Colin .. great catch. I just confirmed that it works on my system with 
$addXsiTypes  = false;
Just need Google to confirm that this is the solution.

Original comment by mole...@knowme.net on 27 Mar 2013 at 5:15

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Issue 88 has been merged into this issue.

Original comment by api.pmat...@gmail.com on 28 Mar 2013 at 7:39

GoogleCodeExporter commented 8 years ago
More info on this thread, it is definitely to do with "xsi:type". See this 
thread:
https://forums.oracle.com/forums/thread.jspa?threadID=944566

We're just attempting to fix the specific version from which to ignore it.

Regards,

- Paul, AdWords API Team.

Original comment by api.pmat...@gmail.com on 28 Mar 2013 at 7:39

GoogleCodeExporter commented 8 years ago
Hi Delkos,

Can you be more specific? Which version of Windows?

Cheers,

- Paul, AdWords API Team.

Original comment by api.pmat...@gmail.com on 28 Mar 2013 at 10:07

GoogleCodeExporter commented 8 years ago
This should be now patched in the latest release:

https://code.google.com/p/google-api-adwords-php/downloads/list

https://code.google.com/p/google-api-adwords-php/source/detail?r=365f3a63326f875
621327147f415e2bab263e1fc

Original comment by api.pmat...@gmail.com on 28 Mar 2013 at 6:13

GoogleCodeExporter commented 8 years ago
Paul & Team - thank you!  Confirmed it's working.

Original comment by colin.mu...@gmail.com on 29 Mar 2013 at 7:43

GoogleCodeExporter commented 8 years ago
Did not work for me even after using the new version.

My PHP version is
PHP 5.2.4 with Suhosin-Patch 0.9.6.2 on FreeBSD

However, I made a hotfix in my API version to get it working:
I changed the AdsSoapClient::PrepareRequest method to not set $addXsiTypes to 
TRUE even for my PHP version.

Original comment by b.schu...@fairrank.de on 2 Apr 2013 at 11:08

GoogleCodeExporter commented 8 years ago
Hi B.Schu...

To help us permanently fix the issue, can you send us what version of LIBXML 
you're using?

You can find this by echoing the variable: LIBXML_DOTTED_VERSION

For example:
    <?php
        echo sprintf('LIBXML version: %s', LIBXML_DOTTED_VERSION);

This goes for anyone else that's been having the issue and wants to help us 
prevent it happening again.

Cheers,

Paul.

Original comment by api.pmat...@gmail.com on 2 Apr 2013 at 12:24

GoogleCodeExporter commented 8 years ago
Hi Paul,

the version number on our companies server is 2.6.30, which is really ancient 
(as the FreeBSD version also is).

I try to ask an administrator to update the version as soon as possible to 
check whether the problem is solved this way.

Original comment by b.schu...@fairrank.de on 2 Apr 2013 at 12:53