Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vtsao opened this issue Dec 20, 2013 · 2 comments
Assignees
Labels

Comments

@vtsao
Copy link
Contributor

vtsao commented Dec 20, 2013

Copied from:
https://groups.google.com/forum/?fromgroups#!topic/google-doubleclick-for-publishers-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'.

This was referenced Dec 20, 2013
@saturnism
Copy link
Contributor

We'll be adding a settings flag so you can set the addXsiTypes value manually.

@vtsao
Copy link
Contributor Author

vtsao commented Apr 11, 2014

Fixed in 5.2.3.

@vtsao vtsao closed this as completed Apr 11, 2014
@vovan47 vovan47 mentioned this issue May 24, 2017
@Telrik Telrik mentioned this issue Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants