SOAP-ERROR: Parsing WSDL

3,391 views
Skip to first unread message

zac439

unread,
Jun 16, 2010, 7:47:11 PM6/16/10
to AdWords API Forum
I'm using the basic PHP connection kit. I've setup the correct
authentication details, and have all the server requirements.

Yet, I still get this:
[faultstring] => SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://
adwords.google.com/api/adwords/o/v201003/TargetingIdeaService?wsdl' :
Start tag expected, '<' not found
[faultcode] => WSDL

Any thoughts?

AdWords API Advisor

unread,
Jun 18, 2010, 7:31:13 AM6/18/10
to AdWords API Forum
Hi Zac,

Seems like the script is not able to retrieve the wsdl document. Have
you checked if the wsdl can be retrieved if the url is loaded in a
fresh browser on the same machine?

Cheers,
Anash P. Oommen,
AdWords API Team

zac439

unread,
Jun 22, 2010, 11:59:07 PM6/22/10
to AdWords API Forum
Thanks for the reply Anash.
I'm using a shell so I'm using wget to check, if that's ok?

Here is the result:

wget -drc https://adwords.google.com/api/adwords/o/v201003/TargetingIdeaService?wsdl
Setting --recursive (recursive) to 1
Setting --continue (continue) to 1
DEBUG output created by Wget 1.10.2 (Red Hat modified) on linux-gnu.

Enqueuing https://adwords.google.com/api/adwords/o/v201003/TargetingIdeaService?wsdl
at depth 0
Queue count 1, maxcount 1.
Dequeuing https://adwords.google.com/api/adwords/o/v201003/TargetingIdeaService?wsdl
at depth 0
Queue count 0, maxcount 1.
--22:55:42-- https://adwords.google.com/api/adwords/o/v201003/TargetingIdeaService?wsdl
=> `adwords.google.com/api/adwords/o/v201003/
TargetingIdeaService?wsdl'
Resolving adwords.google.com... 74.125.19.112
Caching adwords.google.com => 74.125.19.112
Connecting to adwords.google.com|74.125.19.112|:443... connected.
Created socket 3.
Releasing 0x084eef78 (new refcount 1).
Initiating SSL handshake.
Handshake successful; connected socket 3 to SSL handle 0x08504fb8
certificate:
subject: /C=US/ST=California/L=Mountain View/O=Google Inc/
CN=adwords.google.com
issuer: /C=US/O=Google Inc/CN=Google Internet Authority
X509 certificate successfully verified and matches host
adwords.google.com

---request begin---
GET /api/adwords/o/v201003/TargetingIdeaService?wsdl HTTP/1.0
User-Agent: Wget/1.10.2 (Red Hat modified)
Accept: */*
Host: adwords.google.com
Connection: Keep-Alive

---request end---
HTTP request sent, awaiting response...
---response begin---
HTTP/1.0 200 OK
Content-Type: text/xml
Date: Wed, 23 Jun 2010 03:55:43 GMT
Expires: Wed, 23 Jun 2010 03:55:43 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE

---response end---
200 OK
Length: unspecified [text/xml]


[ <=> ]
242,599 --.--K/s

Closed 3/SSL 0x8504fb8
22:55:42 (2.99 MB/s) - `adwords.google.com/api/adwords/o/v201003/
TargetingIdeaService?wsdl' saved [242599]


FINISHED --22:55:42--
Downloaded: 242,599 bytes in 1 files

zac439

unread,
Jun 24, 2010, 1:05:58 AM6/24/10
to AdWords API Forum
It might help if I list some technologies I'm running, since I'm still
getting this error.

PHP version:
5.3.2

Configure Command:
'./configure' '--disable-fileinfo' '--disable-pdo' '--enable-bcmath'
'--enable-calendar' '--enable-ftp' '--enable-gd-native-ttf' '--enable-
libxml' '--enable-mbstring' '--enable-soap' '--enable-sockets' '--
enable-zip' '--prefix=/usr' '--with-bz2' '--with-config-file-path=/usr/
local/lib' '--with-config-file-scan-dir=/usr/local/lib/php.ini.d' '--
with-curl=/opt/curlssl/' '--with-curlwrappers' '--with-freetype-dir=/
usr' '--with-gd' '--with-gettext' '--with-imap=/opt/
php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr'
'--with-kerberos' '--with-libxml-dir=/opt/xml2' '--with-libxml-dir=/
opt/xml2/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/
mysql.sock' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-
pcre-regex=/opt/pcre' '--with-png-dir=/usr' '--with-pspell' '--with-
xpm-dir=/usr/X11R6' '--with-zlib' '--with-zlib-dir=/usr'

Curl/SSL version:
Curl 7.20.1 - OpenSSL 0.9.7a Feb 19 2003



On Jun 22, 10:59 pm, zac439 <ad...@learn-networking.com> wrote:
> Thanks for the reply Anash.
> I'm using a shell so I'm using wget to check, if that's ok?
>
> Here is the result:
>
> wget -drchttps://adwords.google.com/api/adwords/o/v201003/TargetingIdeaService...
> Setting --recursive (recursive) to 1
> Setting --continue (continue) to 1
> DEBUG output created by Wget 1.10.2 (Red Hat modified) on linux-gnu.
>
> Enqueuinghttps://adwords.google.com/api/adwords/o/v201003/TargetingIdeaService...
> at depth 0
> Queue count 1, maxcount 1.
> Dequeuinghttps://adwords.google.com/api/adwords/o/v201003/TargetingIdeaService...
> at depth 0
> Queue count 0, maxcount 1.
> --22:55:42-- https://adwords.google.com/api/adwords/o/v201003/TargetingIdeaService...

zac439

unread,
Jun 24, 2010, 1:06:11 AM6/24/10
to AdWords API Forum
It might help if I list some technologies I'm running, since I'm still
getting this error.

PHP version:
5.3.2

Configure Command:
'./configure' '--disable-fileinfo' '--disable-pdo' '--enable-bcmath'
'--enable-calendar' '--enable-ftp' '--enable-gd-native-ttf' '--enable-
libxml' '--enable-mbstring' '--enable-soap' '--enable-sockets' '--
enable-zip' '--prefix=/usr' '--with-bz2' '--with-config-file-path=/usr/
local/lib' '--with-config-file-scan-dir=/usr/local/lib/php.ini.d' '--
with-curl=/opt/curlssl/' '--with-curlwrappers' '--with-freetype-dir=/
usr' '--with-gd' '--with-gettext' '--with-imap=/opt/
php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr'
'--with-kerberos' '--with-libxml-dir=/opt/xml2' '--with-libxml-dir=/
opt/xml2/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/
mysql.sock' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-
pcre-regex=/opt/pcre' '--with-png-dir=/usr' '--with-pspell' '--with-
xpm-dir=/usr/X11R6' '--with-zlib' '--with-zlib-dir=/usr'

Curl/SSL version:
Curl 7.20.1 - OpenSSL 0.9.7a Feb 19 2003



On Jun 22, 10:59 pm, zac439 <ad...@learn-networking.com> wrote:
> Thanks for the reply Anash.
> I'm using a shell so I'm using wget to check, if that's ok?
>
> Here is the result:
>
> wget -drchttps://adwords.google.com/api/adwords/o/v201003/TargetingIdeaService...
> Setting --recursive (recursive) to 1
> Setting --continue (continue) to 1
> DEBUG output created by Wget 1.10.2 (Red Hat modified) on linux-gnu.
>
> Enqueuinghttps://adwords.google.com/api/adwords/o/v201003/TargetingIdeaService...
> at depth 0
> Queue count 1, maxcount 1.
> Dequeuinghttps://adwords.google.com/api/adwords/o/v201003/TargetingIdeaService...
> at depth 0
> Queue count 0, maxcount 1.
> --22:55:42-- https://adwords.google.com/api/adwords/o/v201003/TargetingIdeaService...

zac439

unread,
Jun 24, 2010, 2:20:01 AM6/24/10
to AdWords API Forum
OK, this is interesting. I looked back at my wget you had me post and
it actually succeeded?

that's odd, because when I use the following, it fails:
wget -O test.xml 'https://adwords.google.com/api/adwords/o/v201003/
TargetingIdeaService?wsdl'

would that mean that my wget/curl is at fault? I'm running centOS if
that helps.
All packages are up to date to my knowledge. I ran yum update.

Wouldn't be a firewall issue, would it?
> > Downloaded: 242,599 bytes in 1 files- Hide quoted text -
>
> - Show quoted text -

AdWords API Advisor

unread,
Jun 24, 2010, 11:51:03 AM6/24/10
to AdWords API Forum
Hi,

Please check the firewall settings in your environment and ensure that
you can access the AdWords API servers. It looks like your current
configuration prevents communication and WSDL downloads.

Best,
- Eric

zac439

unread,
Jun 26, 2010, 1:30:55 PM6/26/10
to AdWords API Forum
Eric-

It isn't a firewall/proxy issue after all. My host got back to me and
said he verified it worked via shell.

What now? I'm still getting the error. It says that the error is on a
line within this function of AdSoapClient.php --

protected function __construct($wsdl, array $options, AdsUser $user,
$serviceName, $serviceNamespace) {
$this->user = $user;
$this->serviceName = $serviceName;
$this->serviceNamespace = $serviceNamespace;
parent::__construct($wsdl, $options);
}

On Jun 24, 10:51 am, AdWords API Advisor

AdWords API Advisor

unread,
Jun 29, 2010, 11:05:27 AM6/29/10
to AdWords API Forum
Hi,

The error indicates that the WSDL couldn't be loaded. You said before
that wget is failing, is that still true? Also, make sure you have
the OpenSSL extension installed in PHP.

Best,
- Eric

zac439

unread,
Jun 29, 2010, 10:08:43 PM6/29/10
to AdWords API Forum
Eric-

wget works, apparently it was a syntax error? My host said they
verified it worked.

I installed OpenSSL myself, and the OS is CentOS.
Curl/SSL version:
Curl 7.20.1 - OpenSSL 0.9.7a Feb 19 2003

Maybe i installed it incorrectly? Is there anyway to test with a piece
of code if it's actually working correctly?

On Jun 29, 10:05 am, AdWords API Advisor

zac439

unread,
Jun 29, 2010, 11:46:38 PM6/29/10
to AdWords API Forum
Eric,

I also noticed that for the "build environment," i need the xsl
library installed.

I do not have it installed, is that a problem? Not sure if I have the
other things in the Build Environment list either. Everything in the
Run Environment I should.

AdWords API Advisor

unread,
Jul 1, 2010, 3:49:50 PM7/1/10
to AdWords API Forum
Hi,

Only the runtime environment dependencies are needed. To isolate the
cause of the problem further, can you try out the no-client library
method detailed here:

http://code.google.com/p/google-api-adwords-php/wiki/NoClientLibrary

Best,
- Eric

zac439

unread,
Jul 7, 2010, 5:22:48 PM7/7/10
to AdWords API Forum
Hi Eric,

I get this error:
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing
WSDL: Couldn't load from 'https://adwords.google.com/api/adwords/cm/
v200909/CampaignService?wsdl' : Start tag expected, '<' not found in /
api/src/Google/Api/Ads/Common/Util/noclient.php:59 Stack trace: #0 /
api/src/Google/Api/Ads/Common/Util/noclient.php(59): SoapClient-
>SoapClient('https://adwords...', Array) #1 {main} thrown in /home/
audio25/public_html/justcompete/api/src/Google/Api/Ads/Common/Util/
noclient.php on line 59

Any thoughts?

Thanks.

On Jul 1, 2:49 pm, AdWords API Advisor <adwordsapiadvi...@google.com>

AdWords API Advisor

unread,
Jul 8, 2010, 6:13:20 PM7/8/10
to AdWords API Forum
Hi,

Can you try downloading the WSDL manually on that machine? It could
be that firewall or other network settings are preventing access to
the WSDL.

Best,
- Eric

zac439

unread,
Jul 11, 2010, 2:38:34 AM7/11/10
to AdWords API Forum
Eric--

Seems like I can download the WSDL just fine. Let me know if this is
what you wanted me to test:

wget https://adwords.google.com/api/adwords/o/v201003/TargetingIdeaService?wsdl

returns this:

https://adwords.google.com/api/adwords/o/v201003/TargetingIdeaService?wsdl
=> `TargetingIdeaService?wsdl.2'
Resolving adwords.google.com... 74.125.19.112
Connecting to adwords.google.com|74.125.19.112|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/xml]

[ <=> ] 242,614 --.--K/s

01:37:02 (2.04 MB/s) - `TargetingIdeaService?wsdl.2' saved [242614]




On Jul 8, 5:13 pm, AdWords API Advisor <adwordsapiadvi...@google.com>

AdWords API Advisor

unread,
Jul 12, 2010, 5:51:55 PM7/12/10
to AdWords API Forum
Hi,

Is an HTTP proxy configured in the shell? If so it must also be
configured in the PHP client library.

Best,
- Eric

On Jul 11, 2:38 am, zac439 <ad...@learn-networking.com> wrote:
> Eric--
>
> Seems like I can download the WSDL just fine. Let me know if this is
> what you wanted me to test:
>
> wgethttps://adwords.google.com/api/adwords/o/v201003/TargetingIdeaService...
>
> returns this:
>
> https://adwords.google.com/api/adwords/o/v201003/TargetingIdeaService...
> ...
>
> read more »

zac439

unread,
Jul 12, 2010, 9:17:40 PM7/12/10
to AdWords API Forum
Eric-

I typed the following:
[root@server ~]# set | grep PROXY

It came up empty, likely meaning there is no proxy in the shell.

Further thoughts?



On Jul 12, 4:51 pm, AdWords API Advisor <adwordsapiadvi...@google.com>
> ...
>
> read more »

zac439

unread,
Jul 14, 2010, 5:56:01 AM7/14/10
to AdWords API Forum
Eric-

Thanks for the help but I solved it. Apparently I had to enable WDDX
in my PHP build.

Can you please add this to the requirements on the API page in case
anyone else doesn't have it enabled?

Thanks Eric!
> ...
>
> read more »

AdWords API Advisor

unread,
Jul 15, 2010, 1:49:35 PM7/15/10
to AdWords API Forum
Hi,

WDDX seems to be completely independent of the client library and its
SOAP services. What made you think to enable this?

Best,
- Eric
> ...
>
> read more »

zac439

unread,
Jul 15, 2010, 6:53:24 PM7/15/10
to AdWords API Forum
Eric-

In scouring the web I found this:
http://codeigniter.com/forums/viewthread/73884/#384673

I noticed WDDX was not enabled in my config, so I enabled it. After
PHP was rebuilt I tried the URL and it worked.
If it is indeed completely independent, I'm not sure what to say. I
just know it worked for me.

Zachary

On Jul 15, 12:49 pm, AdWords API Advisor
> ...
>
> read more »

AdWords API Advisor

unread,
Jul 16, 2010, 5:12:09 PM7/16/10
to AdWords API Forum
Hi,

Thanks for the information. For now I don't think I will add it to
the requirements, as this is the first case I've seen.

Best,
- Eric
> ...
>
> read more »

SarahSmith

unread,
Dec 19, 2010, 11:59:52 PM12/19/10
to adwor...@googlegroups.com
Has anyone since zac439 had this problem and it's been solved by enabling WDDX? I have a different set-up to what was posted in this thread but have the same problem.

I am getting the error: "PHP Fatal error:  SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://adwords-sandbox.google.com/api/adwords/cm/v201008/CampaignService?wsdl' : Start tag expected, '<' not found
 in /......../aw_api/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php on line 143"

If I use file_get_contents and print to the shell, the WSDL does start with the right character. I can open the WSDL URL in a browser (view source shows it starts with the right character). I copied the example code for accessing the API without using the client library and I get the same error (for a different place in a different file). I ran the "set | grep PROXY" command and there was nothing, so I think that means there is no proxy.

PHPinfo tells me, I'm running:
PHP 5.2.14
Zend Engine v2.2.0
libcurl/7.19.2 OpenSSL/0.9.8e zlib/1.2.3
OpenSSL 0.9.8g 19 Oct 2007
SOAP is enabled

Our web server is owned/run by a hosting company for us, and it can be slow to get things done so I'd hate to ask them to install WDDX and not have it fix the problem.

AdWords API Advisor

unread,
Dec 21, 2010, 6:08:09 PM12/21/10
to AdWords API Forum
Hi Sarah,

Do you have WSDL caching enabled? I've seen cases where it's caused
similar issues, so you may want to ensure that it is turned off.

http://code.google.com/p/google-api-adwords-php/source/browse/trunk/src/Google/Api/Ads/AdWords/settings.ini

Best,
- Eric

On Dec 19, 11:59 pm, SarahSmith <sys...@discoveryrentals.com.au>
wrote:
> Has anyone since zac439 had this problem and it's been solved by enabling
> WDDX? I have a different set-up to what was posted in this thread but have
> the same problem.
>
> I am getting the error: "PHP Fatal error:  SOAP-ERROR: Parsing WSDL:
> Couldn't load from
> 'https://adwords-sandbox.google.com/api/adwords/cm/v201008/CampaignSer...

SarahSmith

unread,
Dec 29, 2010, 11:48:18 PM12/29/10
to AdWords API Forum
Definitely off, the only change I've made to settings.ini is to change
the default server to the sandbox URL.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages