如何使SoapUI json请求与德国umlauts工作? [英] How to make SoapUI json request work with german umlauts?

查看:243
本文介绍了如何使SoapUI json请求与德国umlauts工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用SoapUI在我们的团队项目中的许多接口。我们遇到了一个德国特殊标志的问题,称为umlauts。当发送带有Json body和德语变音符号的POST请求时,我们得到 com.fasterxml.jackson.databind.JsonMappingException 。它不能使用 com.fasterxml.jackson.databind.ObjectMapper 解析。

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.

但是当使用POSTMAN发送相同的请求时,它的工作方式就像一个魅力。

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

我们使用 @Consumes({MediaType.APPLICATION_JSON +; charset = utf-8})注释和 Content-Type:application / json; charset = utf-8 头。但还是没有效果。有没有人遇到过这样的问题或知道如何解决它?

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.

推荐答案

在SoapUI中有一个额外的属性,用于设置您的请求的编码。

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

它在请求属性标签下可用。
属性:编码值:UTF-8

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

设置它如上解决了我们的问题。

Setting it as above solved our problem.

这篇关于如何使SoapUI json请求与德国umlauts工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆