Sending an XML file using curl results in:
Invalid XML character (Unicode : 0x<integer>)
Attempt to solve the issue
According to this SO answer the issue will be solved if the XML version is changed to 1.1.
Although the version that resides in the XML file has been updated:
<?xml version="1.1" encoding="utf-8" standalone="yes"?>
curl seems to keep sending the XML as version 1.0.
Second attempt to solve the issue
Another attempt was changing the header that is used while posting using curl as follows:
curl -X POST -H "Content-Type: text/xml; charset=utf-8; version=1.1"
Curl seems to ignore this as the output indicates that xml version 1.0 is used:
* Closing connection #0
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope
Third attempt to solve the issue
@Ƭᴇcʜιᴇ007 advised to create a small XML file:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body>
<note>
<to>Test</to>
</note>
</soap:Body>
</soap:Envelope>
validate the syntax and subsequently post it:
An invalid XML character (Unicode : 0x<integer>) was found
Fourth attempt to solve the issue
According to this answer the issue should not occur as 0x<integer_greater_than_20>
is greater than 0x20.
Fifth attempt to solve the issue
What does 0x<integer_greater_than_20>
represent? According to this table it represents Latin characters that seem to be acceptable.
Sixth attempt to solve the issue
Perhaps the XML file is invalid? No, according to Notepad++' Check XML syntax now option the XML is valid.