SOH and STX charcters are being replaced with quetion mark(?) in the soapui XML file.
We have been trying to create a project in soapui to invoke a rest api service. The rest API service POST method accept text with special charcters(SOH and STX) as request. When we are trying to save the project with .xml file, SOH and STX charcters are being replaced with question mark(?) in xml file.
Below configuration is used in soapui tool.
Service : REST API
Charset : utf-8
Swapping between utf-16 and utf-8 wont make any difference for your issue.
You need to encode your characters correctly!
As I said before (I obviously wasn't clear) escape sequences exist for the control characters you care about (if there wasn't, you wouldn't be able to do anything except delete the chars from your payload):
for the SOH character sequence, replace 'SOH' with ''
for the STX character sequence, replace 'STX' with ''
I've just done this on my machine and I've just executed it fine - the characters are saved as the escape sequences in the XML (see pic)
and the content of my script is
So no issues!
As I said before - whether it was UTF-8 or UTF-16 wouldn't make any difference in this case - UTF-16 is a superset of UTF-8 - i.e. every character in UTF-8 exists in UTF-16. Also - all the characters in UTF-8 have the same escape sequences as the equivalent character in UTF-16.
Hope this has explained a little and helped!
If we add control charcters () in our .xml file while importing to the soapui and testing we are getting an error response as our request is not accepting these chars.
Can you confirm what your requirements state the allowed charset on your submissions is? Those escape sequences work for and endpoint expecting utf-8.
I'll have another look at the other equivalent escapr sequences for these control characters and get back to you with a subsequent post.
did you check the requirements of the allowed charset on your requests - just to confirm? We need to know absolutely what the supported charset that your endpoint is expecting - otherwise you'll never sort this. Its a quick fix once we know - but we need this info fella
For your submissions to your endpoint - do you get a payload for a successful submission? if so - can you confirm what the Content-Type header in the response is please?
I'm guessing application/json - but things can get complicated of it's odata json etc.(e.g. application/json; odata.metadata=minimal;)