GithubHelp home page GithubHelp logo

Comments (14)

stephenyeargin avatar stephenyeargin commented on July 17, 2024

Possible solution:

diff --git a/build_lib/build.xml b/build_lib/build.xml
index 50e6054..730e148 100755
--- a/build_lib/build.xml
+++ b/build_lib/build.xml
@@ -2,8 +2,11 @@
 <!-- ======================================================================= -->
 <!-- See README file for requirements                                        -->
 <!-- ======================================================================= -->
+
 <project basedir="../" default="generate-src" name="adsapi_php">

+  <property file="src/Google/Api/Ads/AdWords/Lib/api.properties" />
+
   <property name="classpath" value="" />
   <property name="out.dir" value="${project.basedir}/src" />
   <property name="product" value="${lib.product}" />

This at least got the library to build.

from googleads-php-lib.

stephenyeargin avatar stephenyeargin commented on July 17, 2024

The build file has changed with v5.3.0 to remove the word pseudo from the name:

;; If enabled, class names (but not service names) will be prefixed with the
;; package name. Ex) Google\Api\Ads\AdWords\Campaign
wsdl2php.enableNamespaces=True

However, I'm still not having any luck with building this as I had with previous versions.

from googleads-php-lib.

saturnism avatar saturnism commented on July 17, 2024

alternatively, you can grab the WSDLInterpreter from the previous branch - those should also generate Pseudonamespaced files properly.

e.g., https://github.com/stephenyeargin/googleads-php-lib/tree/5.2.3/build_lib/WSDLInterpreter

from googleads-php-lib.

stephenyeargin avatar stephenyeargin commented on July 17, 2024

Yeah, that's my current experiment to see if that gets me a bit further down the road. I think it's safe to decide that future versions of the library support PHP 5.3+ and load-in via composer so you guys don't have to worry about such things.

from googleads-php-lib.

saturnism avatar saturnism commented on July 17, 2024

@stephenyeargin pls try to generate the stub w/ the following:

# go into the top repo directory (whenever you cloned the git repo locally)
cd $repo

# make a new branch for pseudo-namespace
git checkout 5.3.0
git checkout -b 5.3.0-pns

# replace build_lib w/ older version
cd build_lib
rm -rf *
git checkout 5.2.3 .

After this, configure it as you did before (i.e., set wsdl2php.enablePseduonamespace to True.)

Please let me know if this can help you move forward. Cheers

from googleads-php-lib.

stephenyeargin avatar stephenyeargin commented on July 17, 2024

@saturnism Re-built the library, now back at where I was with #48. The trouble seems to be around
https://github.com/googleads/googleads-php-lib/blob/master/src/Google/Api/Ads/Common/Lib/SoapClientFactory.php#L166-L167 in that when I have code like:

$servicedAccountService = $this->GetService('ManagedCustomerService', 'v201402', NULL, NULL, $this->validateOnly);

The $serviceName is coming in as ManagedCustomerService, which is correct for loading the file needed, but the class name is actually set up as Google_Api_Ads_AdWords_v201402_ManagedCustomerService. I know in the past the $classmap property was used to make this work smoother with the pseudo namespacing, but I don't know what I'm missing.

from googleads-php-lib.

saturnism avatar saturnism commented on July 17, 2024

@stephenyeargin what version of the client library were you using for v201309?

Thanks,

from googleads-php-lib.

stephenyeargin avatar stephenyeargin commented on July 17, 2024

The answer to that is proving to be hard to ascertain because I didn't commit the build.ini file for some odd reason. I know my last migration finished up on October 31, 2013. Here's the head of AdsUser.php if that gives any indication. My typical process was to grab it from the Google Code site before the migration to GitHub.

<?php
/**
 * Copyright 2011, Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @package    GoogleApiAdsCommon
 * @subpackage Lib
 * @category   WebServices
 * @copyright  2011, Google Inc. All Rights Reserved.
 * @license    http://www.apache.org/licenses/LICENSE-2.0 Apache License,
 *             Version 2.0
 * @author     Adam Rogal <[email protected]>
 * @author     Eric Koleda <[email protected]>
 * @author     Vincent Tsao <[email protected]>
 */
require_once 'Google/Api/Ads/Common/Util/Logger.php';
require_once 'Google/Api/Ads/Common/Util/PeclOAuthHandler.php';
require_once 'Google/Api/Ads/Common/Util/SimpleOAuth2Handler.php';
require_once 'Google/Api/Ads/Common/Lib/SoapClientFactory.php';
require_once 'Google/Api/Ads/Common/Lib/ValidationException.php';

from googleads-php-lib.

saturnism avatar saturnism commented on July 17, 2024

gotcha - and could i trouble you to also send the old api.properties that you used in the previous version?

from googleads-php-lib.

stephenyeargin avatar stephenyeargin commented on July 17, 2024

I believe it was this one. I never bothered to keep the build folder around after we got it into production.

https://code.google.com/p/google-api-adwords-php/source/browse/src/Google/Api/Ads/AdWords/Lib/api.properties?spec=svn6e602ed6a048d15779e64384232ac8004898555b&r=6e602ed6a048d15779e64384232ac8004898555b

That would also put me at ~4.6.1 as the client library version.

from googleads-php-lib.

saturnism avatar saturnism commented on July 17, 2024

@stephenyeargin a few more things that I hope will get you through this for now:

  1. In all of the generated services, replace extends Google_Api_Ads_AdWords_Lib_AdWordsSoapClient with extends extends AdWordsSoapClient
  2. Modify this file Google/Api/Ads/Common/Lib/SoapClientFactory.php
public function GenerateSoapClient($serviceName) {
    ...
    $this->DoRequireOnce($serviceName);
    // Add the following line, assuming you only use the AdWords components
    $serviceName = 'Google_Api_Ads_AdWords_' . $this->GetVersion() . '_' . $serviceName;

    $soapClient = ...
    ...
}

from googleads-php-lib.

stephenyeargin avatar stephenyeargin commented on July 17, 2024

👍 Great news! The suggested changes work. I'll keep testing to see if I run into anything else related to it. I think we can close this issue, pending whatever patch needs to be made to accommodate it for future releases.

screen shot 2014-07-09 at 10 12 13 am

Now I can move on to fixing the rest of the breaking changes from the upgrade 😄

from googleads-php-lib.

saturnism avatar saturnism commented on July 17, 2024

@stephenyeargin thank you for your patience. it would be great if you could share your branch that has the working pseudo-namepsace code in case others need to see it.

from googleads-php-lib.

stephenyeargin avatar stephenyeargin commented on July 17, 2024

Instructions: https://gist.github.com/stephenyeargin/01686190ccf770fe4714
Built Branch: https://github.com/stephenyeargin/googleads-php-lib/tree/5.3.0-pns

I also just saw the blog post announcing v201406. :emoji_for_head_hitting_desk:

from googleads-php-lib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.