-
-
Notifications
You must be signed in to change notification settings - Fork 273
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 1.0 characters causes 500 error #570
Comments
Right now this is assumed it will be handled by the application layer. I'd
be open to a utility in `NetSuite::Utilities` if you could throw up a PR!
…On Fri, Dec 2, 2022 at 11:01 AM Steven Berlan ***@***.***> wrote:
It appears this gem, or at least, NetSuite itself, uses an XML 1.0 parser,
so when a string field includes an invalid unicode character as defined
by the XML 1.0 spec <https://www.w3.org/TR/xml/#charsets>, the response
will cause a 500 error.
Expected behavior:
Either strip or escape invalid unicode characters.
Reproduction:
item = NetSuite::Records::InventoryItem.new
item.item_id = "Ooops \u0003 Invalid Character"
item.add
Result:
<?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: 2; columnNumber: 300; An invalid XML character (Unicode: 0x3) was found in the element content of the document.</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
—
Reply to this email directly, view it on GitHub
<#570>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABE2R6QEFX4PUJBAKJPWSLWLIMPNANCNFSM6AAAAAASSB5TWM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version: 0.8.11
It appears this gem, or at least NetSuite itself, uses an XML 1.0 parser, so when a string field includes an invalid unicode character as defined by the XML 1.0 spec, the response will cause a 500 error.
Expected behavior:
Either strip or escape invalid characters.
Reproduction:
Result:
The text was updated successfully, but these errors were encountered: