require_once('soapclientfactory.php');

16 views
Skip to first unread message

sascha...@gmx.de

unread,
Aug 26, 2008, 4:30:50 AM8/26/08
to AdWords API Forum
Hello!
Just two short questions...

a)
if I try to run the example scripts (PHP) I get a error message
"require_once('soapclientfactory.php');" or something like that. Where
can I find that file? It is not delievered with the nu_soap or the
examples. A search query doesn´t bring any results to that term.

b)
I have a AdWords-Account with customercenter and many subaccounts (for
our customers and internal ads).
The API was registered for our account with the customercenter (the
top-level of our accounts).

Can I feed the subaccounts with the API of the costumercenter?
If not I have to register a new API for the account where it is needed
yet.

Thank you for your time and hopefully your support, too!
Sascha Ballweg

Jan

unread,
Aug 26, 2008, 7:09:08 AM8/26/08
to AdWords API Forum
Hi Sascha,

have you tried APIlity at http://google-apility.sourceforge.net/? It's
a PHP library that supports all API actions and where you don't need
to do anything, just use it. Worked better for me than using the
examples.

For your second question:
Your API tokens work for all your accounts. Just use it.

- Jan

sascha...@gmx.de

unread,
Aug 26, 2008, 10:08:05 AM8/26/08
to AdWords API Forum
Is it nessesary to have PHP5 installed?

Jan

unread,
Aug 26, 2008, 11:07:32 AM8/26/08
to AdWords API Forum
No, you can disable the so called 'OO mode' (see documentation) and
use it perfectly with PHP4.

- Jan

On 26 Aug., 16:08, "saschaball...@gmx.de" <saschaball...@gmx.de>
wrote:

AdWords API Advisor

unread,
Aug 26, 2008, 12:28:12 PM8/26/08
to AdWords API Forum
Hi Sascha,

soapclientfactory.php can be found in the PHP code samples archive
available for download at http://code.google.com/p/adwords-api-php-samples/.
This class creates an object of soapclient class provided by nusoap
library. Alternately, the source code can be viewed at
http://code.google.com/p/adwords-api-php-samples/source/browse/trunk/src/soapclientfactory.php

Cheers,
-Anash P.Oommen, AdWords API Team


On Aug 26, 1:30 pm, "saschaball...@gmx.de" <saschaball...@gmx.de>
wrote:

sascha...@gmx.de

unread,
Aug 27, 2008, 7:54:27 AM8/27/08
to AdWords API Forum
Now I get an Error:
"Parse error: parse error, unexpected T_STRING, expecting
T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /var/www/web7/html/
aw_api/soapclientfactory.php on line 29"

I have already checked the path to the nusoap.php and it is correct.
Any idea?

Sascha

sascha...@gmx.de

unread,
Aug 28, 2008, 3:35:06 AM8/28/08
to AdWords API Forum
A used G-STRING to whom, who finds the unexpected T_STRING ;-))

<?php

// Copyright 2008, 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.


/**
* This class will create an instance of nusoap soapclient for making
SOAP
* calls PHP5 introduced php_soap extension, which introduced a new
class
* called soapclient. This caused nusoap library to rename their
classes to
*nusoap_client. SoapClientFactory will hide this complexity from the
user.
*/

require_once('nusoap/lib/nusoap.php');


class SoapClientFactory{
public static function GetClient(
$endpoint, $wsdl = false, $proxyhost = false, $proxyport = false,
$proxyusername = false, $proxypassword = false, $timeout = 0,
$response_timeout = 30) {
if (!extension_loaded('soap')) {
return new soapclient($endpoint, $wsdl, $proxyhost, $proxyport,
$proxyusername, $proxypassword, $timeout, $response_timeout);
} else {
return new nusoap_client($endpoint, $wsdl, $proxyhost,
$proxyport,
$proxyusername, $proxypassword, $timeout, $response_timeout);
}
}
}
?>

Reply all
Reply to author
Forward
0 new messages