hockeyprincess / google-api-dfp-php

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

Adding XSI type to SOAP request needs to support parsing PHP version labels for PHP installations bundled with Ubuntu. #48

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Copied from:
https://groups.google.com/forum/?fromgroups#!topic/google-doubleclick-for-publis
hers-api/u1PFQiLCjas

I got a problem by post a soap request to dfp (with the standard php library): 
I just got the error message "Unmarshalling error: null". Not very concrete... 
on a dev-server this behaviour does not occur, so I compared both SOAP-Requests 
and found out, that the only difference was in 
"<ns1:authentication xsi:type="ns1:OAuth">*****</ns1:authentication>"
The XSI Type (xsi:type="ns1:OAuth") was not send on the other server. I 
searched in the source code and found the following (dfp_api_2.1.17 is used) in 
the file "AdsSoapClient.php" line 416:

    if (version_compare(PHP_VERSION, '5.2.6', '<') ||
        (PHP_OS == 'Darwin' && version_compare(PHP_VERSION, '5.3.0', '<'))) {
      $addXsiTypes = TRUE;
    }

Here is determined, in which PHP Versions the xsi types are added. However, my 
Version is "5.2.6-1+lenny16" and it seems like it also need these xsi type. So 
I add the following:

    if (version_compare(PHP_VERSION, '5.2.6', '<') ||
        PHP_VERSION === "5.2.6-1+lenny16" ||
        (PHP_OS == 'Darwin' && version_compare(PHP_VERSION, '5.3.0', '<'))) {
      $addXsiTypes = TRUE;
    }

I have no idea, whether all of the PHP 5.2.6 versions are affected, so I extend 
the if-condition only for this special case. My request is to implement this in 
the next release of dfp php library (so it's not necessary to edit the file for 
every update). However, if the problem can be generalized, be aware that the 
command
version_compare(PHP_VERSION, '5.2.6', '=') 
return false with the PHP Version '5.2.6-1+lenny16'.

Original issue reported on code.google.com by vt...@google.com on 2 Oct 2013 at 1:30

GoogleCodeExporter commented 8 years ago
This has been moved to GitHub, please continue discussion there:
https://github.com/googleads/googleads-php-lib/issues/2

Original comment by vt...@google.com on 14 Jan 2014 at 5:10