SOAP-ERROR: Encoding: Error calling from_xml callback

526 views
Skip to first unread message

Mustafa D.

unread,
Nov 11, 2011, 2:47:24 AM11/11/11
to AdWords API Forum
Hi,
201109 I want to use the new version.
However, I receive an error like the following example php files in
general. What is the source of this problem. Please help.

SOAP-ERROR: Encoding: Error calling callback from_xml

Thank you for your help.

Kevin Winter

unread,
Nov 14, 2011, 10:49:48 AM11/14/11
to adwor...@googlegroups.com
Hi,
  Are you using the PHP client library? Do you receive a SOAP XML response or is this breaking in the request phase?  Any additional information you can provide about exactly what is happening when this error occurs will help us troubleshoot.

- Kevin Winter
AdWords API Team

Eric Koleda

unread,
Nov 22, 2011, 11:44:34 AM11/22/11
to adwor...@googlegroups.com
Hi Mustafa,

If you continue to receive this error please open a bug here:


Best,
- Eric Koleda, AdWords API Team

sax

unread,
Nov 25, 2011, 10:52:20 AM11/25/11
to AdWords API Forum
I'm having the same problem.

Line: 202, file: aw_api_php_lib_2.7.1/src/Google/Api/Ads/Common/Lib/
AdsSoapClient.php
Exception: SOAP-ERROR: Encoding: Error calling callback from_xml
Backtrace:
#0 xxxxx/aw_api_php_lib_2.7.1/src/Google/Api/Ads/Common/Lib/
AdsSoapClient.php(202): SoapClient->__soapCall('get', Array, NULL,
Array, Array)
#1 xxxxx/aw_api_php_lib_2.7.1/src/Google/Api/Ads/AdWords/v201109/
AdGroupService.php(4489): AdsSoapClient->__soapCall('get', Array)
#2 xxxxx/bootstrap.php(71): AdGroupService->get(Object(Selector))

The server is debian with PHP5.2
The same script is working without problem on Win7 + PHP5.3

Eric Koleda

unread,
Nov 28, 2011, 10:25:46 AM11/28/11
to adwor...@googlegroups.com
Hi,

I'm not able to emulate this with PHP 5.2.4.  Can you provide more details about the environment you are running this on?

Best,
- Eric

sax

unread,
Nov 30, 2011, 5:00:36 AM11/30/11
to AdWords API Forum
Hi Eric,
mi version is a bit older: PHP Version 5.2.0-8+etch11

Below some details about the request:

request_info.log:
[Nov 30 2011 10:46:00.u - ERROR] email=adw...@xxxx.xx
effectiveUser=402-xxx-xxxx service=AdGroupService method=get
operators={IN: 2} responseTime=441
requestId=0004b2f0b4696d900a11391100002df3 operations=1 units=1
server=adwords.google.com isFault=true faultMessage=SOAP-ERROR:
Encoding: Error calling from_xml callback

soap_xml.log:
[Nov 30 2011 10:46:00.u - ERROR] POST /api/adwords/cm/v201109/
AdGroupService HTTP/1.1
Host: adwords.google.com
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.2.0-8+etch11, gzip
Accept-Encoding: gzip, deflate
Content-Encoding: gzip
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 810

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:ns1="https://adwords.google.com/api/adwords/cm/
v201109">
<SOAP-ENV:Header>
<ns1:RequestHeader xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xsi:type="ns1:SoapHeader">
<ns1:authToken>*****</ns1:authToken>
<ns1:clientCustomerId>402-XXX-XXXX</ns1:clientCustomerId>
<ns1:developerToken>T8GIbqlW5X9_c36wDEeuKA</ns1:developerToken>
<ns1:userAgent>AwApi-PHP-2.7.1-XXX S.r.l. XXX</ns1:userAgent>
</ns1:RequestHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:get>
<ns1:serviceSelector xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xsi:type="ns1:Selector">
<ns1:fields>Id</ns1:fields>
<ns1:fields>Name</ns1:fields>
<ns1:predicates xsi:type="ns1:Predicate">
<ns1:field>CampaignId</ns1:field>
<ns1:operator>IN</ns1:operator>
<ns1:values>60403254</ns1:values>
</ns1:predicates>
<ns1:predicates xsi:type="ns1:Predicate">
<ns1:field>Status</ns1:field>
<ns1:operator>IN</ns1:operator>
<ns1:values>ENABLED</ns1:values>
</ns1:predicates>
<ns1:ordering xsi:type="ns1:OrderBy">
<ns1:field>Name</ns1:field>
<ns1:sortOrder>ASCENDING</ns1:sortOrder>
</ns1:ordering>
</ns1:serviceSelector>
</ns1:get>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

HTTP/1.1 200 OK
Content-Type: text/xml; charset=UTF-8
Content-Encoding: gzip
Date: Wed, 30 Nov 2011 09:53:16 GMT
Expires: Wed, 30 Nov 2011 09:53:16 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Content-Length: 307
Server: GSE

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/
v201109">
<requestId>0004b2f0b4696d900a11391100002df3</requestId>
<serviceName>AdGroupService</serviceName>
<methodName>get</methodName>
<operations>1</operations>
<responseTime>441</responseTime>
<units>1</units>
</ResponseHeader>
</soap:Header>
<soap:Body>
<getResponse xmlns="https://adwords.google.com/api/adwords/cm/
v201109">
<rval>
<totalNumEntries>0</totalNumEntries>
<Page.Type>AdGroupPage</Page.Type>
</rval>
</getResponse>
</soap:Body>
</soap:Envelope>

Best,
Francesco

Eric Koleda

unread,
Nov 30, 2011, 5:56:41 PM11/30/11
to adwor...@googlegroups.com
Hi Francesco,

I'm having trouble installing 5.2.0 on my system, so I'm not able to test this directly.  I think what's going on is that the from_xml callback (AdsSoapClient::TypemapLongFromXml) is running into an error when trying to parse the XML (in XmlUtils::GetDomFromXml).  Can you try catching the exception there and see what the underlying cause is?  Perhaps also take a look at the XML it's trying to parse.

Best,
- Eric
Reply all
Reply to author
Forward
0 new messages