Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid XML Character fails CMS Metada Service API #226

Open
mmfaizals opened this issue Oct 1, 2021 · 2 comments
Open

Invalid XML Character fails CMS Metada Service API #226

mmfaizals opened this issue Oct 1, 2021 · 2 comments
Assignees
Labels

Comments

@mmfaizals
Copy link

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)
@nwbirnie
Copy link
Contributor

nwbirnie commented Oct 5, 2021

Hey @christopherseeley could you take a look?

@christopherseeley
Copy link
Member

This is an issue with how the library handles logging. The response is correctly read by the Axis SOAP deserializer, but not by our logger's XML parser.

This doesn't block your application from getting the data, but you will have spurious error logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants