根据结果或错误,使用POST作为有效负载的以下响应作为MVC控制器之下的服务调用:
有效结果时:
<document>
<merchant>......</merchant>
</document>
和错误:
<response>
<error>Some error...</error>
</response>
Java代码:
@RequestMapping(value = "card/payment-response", method = RequestMethod.POST)
public int responsePayment(@RequestBody ResponseContext responseContext) {
System.out.println(responseContext);
return 0;
}
如何使用相同的@RequestBody读取两者?