googleads / googleads-java-lib

Google Ad Manager SOAP API Client Library for Java
Apache License 2.0
226 stars 360 forks source link

Unmarshalling Error: ParseError Message: Character reference "&# during keyword search by text #203

Closed aharbunou closed 10 months ago

aharbunou commented 4 years ago

Hi,

From time to time when we do keyword (biddable ad group criterion) search by text we see the following error : Caused by: org.apache.axis.AxisFault: Unmarshalling Error: ParseError at [row,col]:[1,1523] Message: Character reference "&# at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222) ~[axis-1.4.jar:na] at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129) ~[axis-1.4.jar:na] at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087) ~[axis-1.4.jar:na] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609) ~[na:1.8.0_151] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782) ~[na:1.8.0_151] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2967) ~[na:1.8.0_151] at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602) ~[na:1.8.0_151] at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112) ~[na:1.8.0_151] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505) ~[na:1.8.0_151] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841) ~[na:1.8.0_151] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770) ~[na:1.8.0_151] at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) ~[na:1.8.0_151] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) ~[na:1.8.0_151] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643) ~[na:1.8.0_151] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327) ~[na:1.8.0_151] at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) ~[axis-1.4.jar:na] at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) ~[axis-1.4.jar:na] at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) ~[axis-1.4.jar:na] at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) ~[axis-1.4.jar:na] at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) ~[axis-1.4.jar:na] at org.apache.axis.client.Call.invokeEngine(Call.java:2784) ~[axis-1.4.jar:na] at org.apache.axis.client.Call.invoke(Call.java:2767) ~[axis-1.4.jar:na] at org.apache.axis.client.Call.invoke(Call.java:2443) ~[axis-1.4.jar:na] at org.apache.axis.client.Call.invoke(Call.java:2366) ~[axis-1.4.jar:na] at org.apache.axis.client.Call.invoke(Call.java:1812) ~[axis-1.4.jar:na] at com.google.api.ads.adwords.axis.v201809.cm.AdGroupCriterionServiceSoapBindingStub.get(AdGroupCriterionServiceSoapBindingStub.java:1688) ~[adwords-axis-4.10.0.jar:na] at sun.reflect.GeneratedMethodAccessor2842.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151] at com.google.api.ads.common.lib.soap.SoapClientHandler.invoke(SoapClientHandler.java:100) ~[ads-lib-4.10.0.jar:na] at com.google.api.ads.common.lib.soap.axis.AxisHandler.invokeSoapCall(AxisHandler.java:234) ~[ads-lib-axis-4.10.0.jar:na] at com.google.api.ads.common.lib.soap.SoapServiceClient.callSoapClient(SoapServiceClient.java:63) ~[ads-lib-4.10.0.jar:na] at com.google.api.ads.common.lib.soap.SoapServiceClient.invoke(SoapServiceClient.java:93) ~[ads-lib-4.10.0.jar:na] at com.sun.proxy.$Proxy48.get(Unknown Source) ~[na:na] at sun.reflect.GeneratedMethodAccessor702.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151] at com.google.api.ads.adwords.extension.ratelimiter.ApiRateLimiter$1.call(ApiRateLimiter.java:52) ~[adwords-extension-ratelimiter-0.1.0.jar:na] at com.google.api.ads.adwords.extension.ratelimiter.ApiRetryHelper.callWithRetries(ApiRetryHelper.java:87) ~[adwords-extension-ratelimiter-0.1.0.jar:na] at com.google.api.ads.adwords.extension.ratelimiter.ApiRateLimiter.run(ApiRateLimiter.java:60) ~[adwords-extension-ratelimiter-0.1.0.jar:na] at com.google.api.ads.adwords.extension.ratelimiter.ApiInvocationHandlerWithRateLimiter.handleInvocation(ApiInvocationHandlerWithRateLimiter.java:45) ~[adwords-extension-ratelimiter-0.1.0.jar:na] at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:84) ~[guava-22.0.jar:na] SOAP Fault resposne `<?xml version="1.0" encoding="UTF-8" standalone="no"?>

soap:Client Unmarshalling Error: ParseError at [row,col]:[1,1523] Message: Character reference "&# ` Selector code is `new SelectorBuilder() .fields(AdGroupCriterionField.Id, AdGroupCriterionField.KeywordText, AdGroupCriterionField.Labels, AdGroupCriterionField.AdGroupId) .in(AdGroupCriterionField.KeywordText, {list of keyword texts}) .build()` Google AdWords Lib version is 4.10.0. Unfortunately, I don't have an example of keyword text that failed as it is not consistent and requires code changes. What could be the reason to have this kind of errors? Is it possible to make SOAP XML request invalid by input data using the lib? Thanks, Andrei
nwbirnie commented 4 years ago

This is a strange issue. Checking the location of the stack trace org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) you can see that this is processing the response, and specifically, it's enforcing a must understand constraint in the response. However I don't see any evidence of us returning a response which contains a mustUnderstand header.

Are you able to get the SOAP response XML via our logger? If so please redact any sensitive information and paste the request + response with headers etc. If it's easier to censor we can also coordinate this over email.

Alternatively, we should be able to get the logs for this request from the underlying SOAP toolkit. We use Apache Axis 1.4, which in turn logs to Jakarta Commons Logging (which is a facade for e.g. log4j). You can get the raw HTTP logs locally by configuring log4j like this (and similarly for other logging frameworks):

log4j.logger.org.apache.axis=OFF,CONSOLE
log4j.logger.org.apache.axis.transport.http=DEBUG
log4j.logger.org.apache.axis.message=DEBUG
log4j.logger.org.apache.axis.encoding=DEBUG

If possible it would be great if you could grab both sets of logs, but we can take a look at the client library's logs first to see if there's anything obviously wrong.

script_5f._4ed943_0000_28eb_809a_94eb2c06321c

christopherseeley commented 10 months ago

The AdWords API has been turned down and replaced by the Google Ads API. Closing as stale.