An invalid XML character (Unicode: 0xc)

1,027 views
Skip to first unread message

Tatiana Kononova

unread,
Oct 23, 2015, 6:34:16 AM10/23/15
to Google's DoubleClick for Publishers API Forum
Hi,

Today we found strange behavior with PQL statement requests for one of our clients, networkCode=95377733. 
DFP library version is v201502.

Request example:

 Statement filterStatement = new StatementBuilder().where("lastModifiedDateTime >= '2015-10-22T04:06:23'").toStatement();
 
Creative[] creatives = creativeServiceInterface.getCreativesByStatement(filterStatement).getResults();

translates to SOAP request:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   
<soapenv:Header>
       
<ns1:RequestHeader xmlns:ns1="https://www.google.com/apis/ads/publisher/v201502" soapenv:mustUnderstand="0">
           
<ns1:networkCode>95377733</ns1:networkCode>
           
<ns1:applicationName>AdMax (DfpApi-Java, Dfp-Axis/1.39.0, Common-Java/1.14.1, Axis/1.4, Java/1.8.0_51, maven)</ns1:applicationName>
       
</ns1:RequestHeader>
   
</soapenv:Header>
   
<soapenv:Body>
       
<getCreativesByStatement xmlns="https://www.google.com/apis/ads/publisher/v201502">
           
<filterStatement>
               
<query>WHERE lastModifiedDateTime &gt;= '2015-10-22T04:06:23'</query>
           
</filterStatement>
       
</getCreativesByStatement>
   
</soapenv:Body>
</soapenv:Envelope>

Take a look on query. 
<query>WHERE lastModifiedDateTime &gt;= '2015-10-22T04:06:23'</query>
 It should be "greater or equal" condition (>=), but here is "&gt;=".

SOAP response in such case:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   
<soapenv:Body>
       
<soapenv:Fault>
           
<faultcode>soapenv:Server.userException</faultcode>
           
<faultstring>org.xml.sax.SAXParseException; lineNumber: 9429; columnNumber: 178; An invalid XML character (Unicode: 0xc) was found in the element content of the document.</faultstring>
           
<detail>
               
<ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">org.xml.sax.SAXParseException; lineNumber: 9429; columnNumber: 178; An invalid XML character (Unicode: 0xc) was found in the element content of the document.
 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
 at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
 at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
 at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1437)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2927)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
 at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
 at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
 at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
 at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
 at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
 at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
 at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
 at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
 at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
 at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
 at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
 at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
 at org.apache.axis.client.Call.invoke(Call.java:2767)
 at org.apache.axis.client.Call.invoke(Call.java:2443)
 at org.apache.axis.client.Call.invoke(Call.java:2366)
 at org.apache.axis.client.Call.invoke(Call.java:1812)
 at com.google.api.ads.dfp.axis.v201502.CreativeServiceSoapBindingStub.getCreativesByStatement(CreativeServiceSoapBindingStub.java:1451)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:497)
 at com.google.api.ads.common.lib.soap.SoapClientHandler.invoke(SoapClientHandler.java:109)
 at com.google.api.ads.common.lib.soap.axis.AxisHandler.invokeSoapCall(AxisHandler.java:213)
 at com.google.api.ads.common.lib.soap.SoapServiceClient.callSoapClient(SoapServiceClient.java:64)
 at com.google.api.ads.common.lib.soap.SoapServiceClient.invoke(SoapServiceClient.java:93)
 at com.sun.proxy.$Proxy25.getCreativesByStatement(Unknown Source)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:497)
 at com.maxifier.integration.DFP6ServiceProxy.invoke(DFP6ServiceProxy.java:64)
 at com.sun.proxy.$Proxy25.getCreativesByStatement(Unknown Source)
 at com.maxifier.integration.DFP6ServiceLUTest.getLastModCreatives(DFP6ServiceLUTest.java:509)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:497)
 at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
 at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
 at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
 at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
 at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
 at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
 at org.testng.TestRunner.privateRun(TestRunner.java:767)
 at org.testng.TestRunner.run(TestRunner.java:617)
 at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
 at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
 at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
 at org.testng.SuiteRunner.run(SuiteRunner.java:254)
 at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
 at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
 at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
 at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
 at org.testng.TestNG.run(TestNG.java:1057)
 at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
 at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
 at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
 at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:125)
</ns1:stackTrace>
               
<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">kononova</ns2:hostname>
           
</detail>
       
</soapenv:Fault>
   
</soapenv:Body>
</soapenv:Envelope>

There is only one client with such problem. Please, check what's wrong with it.

Chris Seeley (DFP API Team)

unread,
Oct 23, 2015, 3:02:10 PM10/23/15
to Google's DoubleClick for Publishers API Forum
Hi Tatiana,

This isn't a problem with the &gt; characters. That's just the XML escaped equivalent of >.

Is the error you provided from that exact request? These are typically caused by a problematic entity in the DFP network. If you can provide an exact SOAP request that causes the error it'll help me track it down.

Thanks,
Chris Seeley, DFP API Team 

Tatiana Kononova

unread,
Oct 25, 2015, 1:26:50 AM10/25/15
to Google's DoubleClick for Publishers API Forum
Hi, Chris,

Yes, of course, error I provided is from provided request. Unfortunately, I can't define concrete entity to help you.

Tatiana Kononova

unread,
Oct 26, 2015, 4:31:47 AM10/26/15
to Google's DoubleClick for Publishers API Forum
Hi, 

I found some details.

Problem creative entity can be found with following request:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   
<soapenv:Header>
       
<ns1:RequestHeader xmlns:ns1="https://www.google.com/apis/ads/publisher/v201502" soapenv:mustUnderstand="0">
           
<ns1:networkCode>95377733</ns1:networkCode>

           
<ns1:applicationName>AdMax (DfpApi-Java, Dfp-Axis/2.5.0, Common-Java/1.14.1, Axis/1.4, Java/1.8.0_51, maven)</ns1:applicationName>

       
</ns1:RequestHeader>
   
</soapenv:Header>
   
<soapenv:Body>
       
<getCreativesByStatement xmlns="https://www.google.com/apis/ads/publisher/v201502">
           
<filterStatement>

               
<query>WHERE lastModifiedDateTime &gt;= '2015-10-22T04:06:23' LIMIT 1 OFFSET 282</query>

           
</filterStatement>
       
</getCreativesByStatement>
   
</soapenv:Body>
</soapenv:Envelope>

Checking one by one I found offset number 282, which fails. But I can't get any details (ID is mostly interested) via API - CreativeServiceInterface#getCreativesByStatement try return CreativePage entirely and return error. Can you find on your side ID of this problem entity?

Chris Seeley (DFP API Team)

unread,
Oct 26, 2015, 8:46:39 AM10/26/15
to Google's DoubleClick for Publishers API Forum
Hi Tatiana,

Thanks for the extra information. I found a custom creative with invalid characters that's causing this. Its ID is 84640729693. You can skip this ID in your filter for now, and work with the client to correct the creative via the UI. The invalid characters are contained in the HTML snippet.

Thanks,
Chris Seeley, DFP API Team

Tatiana Kononova

unread,
Oct 26, 2015, 8:55:12 AM10/26/15
to Google's DoubleClick for Publishers API Forum
Hi, Chris,

Thanks for your help!
Reply all
Reply to author
Forward
0 new messages