6

We use SoapUI for many interfaces in our team project. We came across a problem with german special signs, called umlauts. When sending a POST request with Json body and a german umlaut, the we get com.fasterxml.jackson.databind.JsonMappingException. It cannot be parsed with com.fasterxml.jackson.databind.ObjectMapper.

SoapUI Json request

But when sending the same request using POSTMAN, then it works like a charm. Postman Json request

We use @Consumes({MediaType.APPLICATION_JSON + "; charset=utf-8"}) annotations and Content-Type: application/json; charset=utf-8 header. But still no effect. Has anyone ever came across such a problem or know how to solve it? We cannot change the testing tool.

Mateusz Sobala
  • 366
  • 2
  • 10
  • Just one addition to the comment from user3499394. That is what worked for me (thanks!), however when I set the same using: "Content-type: application/xml; charset=UTF-8" directly in the headers of my request, it does not behave the same. The only thing that works is actually setting encoding via Properties tab. This must be a bug in SoapUI. My version of SoapUI is 5.2.1. – Boris Gligorijević Aug 11 '17 at 12:07
  • @BorisGligorijević, same problem here with 5.3.0. Resolved also only with the Properties tab. – benichka Apr 18 '18 at 11:29
  • BTW, if you are looking for a mock service to return proper UTF-8, you will need to add "-Dfile.encoding=UTF8" to \bin\.vmoptions file – Tschenser Jan 15 '21 at 20:03

1 Answers1

18

In SoapUI there is an additional property for setting the encoding of your request.

It is available under the tab Request Properties. Property: Encoding, Value: UTF-8.

Setting it as above solved our problem.

Mateusz Sobala
  • 366
  • 2
  • 10