我有以下try块中我期待从exchange方法的RestTemplate响应空字段:RestTemplate返回指定对象
try{
response = restOperations.exchange("http://localhost:8080/midpoint/ws/rest/users/00000000-0000-0000-0000-000000000002",
HttpMethod.GET,
new HttpEntity(createHeaders("administrator", "5ecr3t")),
UserType.class);
logger.info(response.getBody());
}
我期待UserType类型的响应,该请求被执行正确的状态为200 OK,但UserType模型的所有字段都为空,因此我从REST调用收到的响应不是绑定(映射)。 的UserType必填字段注释为:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "UserType", propOrder = {
"fullName",
"givenName",
"familyName",
"additionalNames",
"locality",
"assignment",
"activation",
"specialWithInternalizedName",
"singleActivation",
"multiActivation",
"multiActivationCopy",
"singleConstruction",
"multiConstruction",
"multiConstructionCopy"
})
服务器响应的一个例子:
administrator
2017-01-31T14:04:14.575+01:00
2017-01-31T14:04:14.658+01:00
http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#init
2017-01-31T14:04:14.575+01:00
2017-01-31T14:04:14.658+01:00
http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#init
enabled
enabled
enabled
2017-01-31T14:04:14.598+01:00
normal
0
midPoint Administrator
midPoint
Administrator
2017-02-16T17:01:21.861+01:00
2017-02-16T16:44:00.493+01:00
2017-01-31T14:04:14.598+01:00
http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#init
http://www.w3.org/2001/04/xmlenc#aes128-cbc
HZZUFItbX7fYQO41GT3PHJtIf2Q=
SZusPiIgcrzoqDfm9uTzmrI6r4lG/OolTRIc7V/0aVo=
+0
你能分享一个示例回应吗? –
+0
我已经更新了我的问题,并提供了回复示例 –