How to set encoding UTF-8 in request post ?

Originally posted by asmabel on September 10, 2009

Hello everybody,
I have problem with send parameter in UTF-8 encoding. When I use browser every thing is correct. When I use SOPA UI, servlet is not able recognize characters in UTF-8.
The only thing what I do in HTTP Test Request is setting encoding property to UTF-8.
Maybe I should do something more.
My POST request in SOAP UI looks like:

POST http://localhost:8080/WebTest/Test?text … 4%85%C4%85 HTTP/1.1

Accept-Encoding: gzip,deflate

Content-Type: text/xml

User-Agent: Jakarta Commons-HttpClient/3.1

Host: localhost:8080

Content-Length: 0

Do you have any idea ?
Thanks for help

Originally posted by SmartBear_Suppo on September 15, 2009

Hi,

You can manually add the Content-Type header and it will override the generated one. Go into the “Headers” tab for the request and add a new header. Name it “Content-Type” (without the quotes) and set the value to “text/xml; charset=utf-8” (again, no quotes). Good luck!

Regards,
Dain
eviware.com

Originally posted by feckhar on December 03, 2015

Thank you for this help, setting the header in the request. If the response is coming back in IBM037, how do I set this header?

Originally posted by nmrao on December 03, 2015

Question does not seem to be clear. Can you elaborate what you mean?

Originally posted by feckhar on December 03, 2015

When I try to build a project in SoapUI and the input WSDL has this tag at the top –

“<?xml version="1.0" encoding="IBM037"?>” - it will not load.

So I tried removing the encoding or trying utf-8:

“<?xml version="1.0"?>” or “<?xml version="1.0" encoding="utf-8"?>”

The SoapUI project loads, the request is sent, but I get this error:

“Error getting response;javax.net.ssl.SSLException:Unrecognized SSL message,plaintext connection?” .

This makes sense, the end-point software is returning a response encoded IBM037 and I am expecting text.

I don’t know how to load the WSDL.

Originally posted by nmrao on December 03, 2015

Looks, you opened another topic mentioning the same.

Originally posted by bdupont on September 29, 2017

Hello, quoting:

You can manually add the Content-Type header and it will override the generated one. Go into the “Headers” tab for the request and add a new header. Name it “Content-Type” (without the quotes) and set the value to “text/xml; charset=utf-8” (again, no quotes). Good luck!

→ That’s fine for one test, but what if you want to do this for all your requests by default ?

I guess I can do that with groovy scripts, but is there an integrated way?