googleads / googleads/googleads-java-lib

Invalid XML Character fails CMS Metada Service API

Open
#226 2 comments 0 reactions 1 assignee View on GitHub

@christopherseeley is already working on this.

Since Oct 5, 2021.

bug P2
Dominant language
Java
Stars
234
Forks
360
PR merge metrics
No merged PRs in 30d

Description

Invalid XML character in cms metadata API response causes failure in parsing

Example response :

<getCmsMetadataValuesByStatementResponse
                        xmlns="https://www.google.com/apis/ads/publisher/v202105">
                        <rval>
                            <totalResultSetSize>4743558</totalResultSetSize>
                            <startIndex>1562500</startIndex>
                            <results>
                                <cmsMetadataValueId>5921712000</cmsMetadataValueId>
                                <valueName>&#xD83D;&#xDD34; minecraft xbox mini games livestream</valueName>
                                <key>
                                    <id>12697</id>
                                    <name>keywords</name>
                                    <status>ACTIVE</status>
                                </key>
                                <status>ACTIVE</status>
                            </results>

Stacktrace :

Fatal Error] :1:58805: Character reference "&#xD83D" is an invalid XML character.
[Sep 09 07:20:36] [d9f62cac6bf545bfbdb16acd85aef077/247051] WARN  com.google.api.ads.common.lib.utils.logging.AdsServiceLoggers.ads_api_lib (PrettyPrinter.java:123) - Unable to pretty print XML: {}
javax.xml.transform.TransformerException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 58805; Character reference "&#xD83D" is an invalid XML character.
        at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:501)
        at com.google.api.ads.common.lib.utils.logging.PrettyPrinter.formatXml(PrettyPrinter.java:120)
        at com.google.api.ads.common.lib.utils.logging.PrettyPrinter.prettyPrint(PrettyPrinter.java:106)
        at com.google.api.ads.common.lib.utils.logging.RemoteCallLoggerDelegate.logRequestDetails(RemoteCallLoggerDelegate.java:108)
        at com.google.api.ads.common.lib.utils.logging.AdsServiceLoggers.logRequest(AdsServiceLoggers.java:61)
        at com.google.api.ads.common.lib.client.AdsServiceClient.logSoapCall(AdsServiceClient.java:94)
        at com.google.api.ads.common.lib.soap.SoapServiceClient.invoke(SoapServiceClient.java:95)
        at com.sun.proxy.$Proxy121.getCmsMetadataValuesByStatement(Unknown Source)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.