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 1.0 characters causes 500 error #570

Open
sberlan-odeko opened this issue Dec 2, 2022 · 1 comment
Open

Invalid XML 1.0 characters causes 500 error #570

sberlan-odeko opened this issue Dec 2, 2022 · 1 comment

Comments

@sberlan-odeko
Copy link

sberlan-odeko commented Dec 2, 2022

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:

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>
@iloveitaly
Copy link
Member

iloveitaly commented Dec 5, 2022 via email

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

No branches or pull requests

2 participants