我实现了一个Rest EndPoint,用作侦听某些外部平台的侦听器,一旦来自外部系统的更新准备就绪,我的Rest侦听器将以HttpServletRequest
的形式接收xml消息,这是参数我的EndPoint。
此侦听器使用Swagger记录,现在我希望用户通过提供xml从Swagger中对其进行测试。
我们非常感谢您的帮助。
@RequestMapping(path = "/listener", method = RequestMethod.POST, produces = "application/json", consumes = "application/xml")
@ApiOperation(value = "Listener for async messages")
@ApiImplicitParams({
@ApiImplicitParam(name = "req-id", value = "The req id with which to associate this request", paramType = "header", required = false, dataType = "java.lang.String"),
})
public @ResponseBody BaseModel processListener(HttpServletRequest request, HttpServletResponse response) {
----------
---------
}
这是实现我的侦听器并使用request.getReader()
读取请求的方式